package com.aspose.cells;

import java.io.InputStream;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;

public class Cells implements Iterable {
   double a;
   private boolean f;
   private HorizontalPageBreakCollection g;
   private VerticalPageBreakCollection h;
   private zani i;
   zaau b;
   private zbpx j;
   private zr k;
   private RowCollection l;
   private Worksheet m;
   private PageSetup n;
   zagg c;
   zagf d;
   private boolean o;
   private int p;
   private int q;
   private int r;
   private int s;
   private Row t;
   private int u;
   private int v;
   private boolean w;
   short e;
   private byte x;
   private ColumnCollection y;
   private byte z;
   private byte A;
   private RangeCollection B;

   public int getCount() {
      if (this.v < 0) {
         this.v = 0;
         zahl var1 = this.k.b();

         while(true) {
            int var2 = var1.a();
            if (var2 < 0) {
               break;
            }

            zp var3 = this.k.f(var2);
            this.v += var3.a();
         }
      }

      return this.v;
   }

   public Iterator iterator() {
      return new zhg(this, false, 7);
   }

   public Iterator getRowEnumerator() {
      return this.l.a.a(-1, -1, false);
   }

   double a() {
      return this.a;
   }

   int b() {
      return (int)this.a;
   }

   HorizontalPageBreakCollection c() {
      return this.g;
   }

   VerticalPageBreakCollection d() {
      return this.h;
   }

   zbpx e() {
      return this.j;
   }

   zr f() {
      return this.k;
   }

   void a(int var1, int var2, int var3) {
      this.k = this.a(var1, var2, 20, var3);
      this.l.a(this.k);
   }

   void g() {
      this.k.j(64, 32);
   }

   void a(int var1, int var2) {
      this.k.j(var1, var2);
   }

   zr a(int var1, int var2, int var3, int var4) {
      return this.k.c() ? this.a(1, var1, var2, var3, var4) : this.a(0, var1, var2, var3, var4);
   }

   private zr a(int var1, int var2, int var3, int var4, int var5) {
      Object var6;
      switch(var1) {
      case 1:
         var6 = new zbay(var2, var3, var4, var5, this.m.c().g, this.b);
         break;
      default:
         var6 = new zbaz(var2, var4, this.m.c().g, this.b);
      }

      ((zr)var6).a(this.o);
      return (zr)var6;
   }

   public RowCollection getRows() {
      return this.l;
   }

   Cells(zbpx stringTable, Worksheet sheet) {
      this.o = zml.q;
      this.p = -1;
      this.q = -1;
      this.r = -1;
      this.s = -1;
      this.t = null;
      this.u = -1;
      this.v = -1;
      this.e = -1;
      this.x = 0;
      this.m = sheet;
      this.j = stringTable;
      this.y();
   }

   Worksheet h() {
      return this.m;
   }

   private void y() {
      this.b = new zaau(this.m);
      this.r().n().c();
      this.B = new RangeCollection();
      this.g = new HorizontalPageBreakCollection();
      this.h = new VerticalPageBreakCollection();
      this.i = new zani();
      int var1 = this.r().I() * 8 + this.r().J();
      int var2 = (var1 / 8 + 1) * 8;
      double var3 = 8.0D + (double)(var2 - var1) * 1.0D / (double)this.r().I();
      this.a = 255.0D;
      this.f = false;
      if (this.r().L() != 96) {
         this.a = 264.0D;
      }

      this.k = this.a(this.m.getWorkbook().getSettings().getMemorySetting(), 64, 32, 16, 16);
      this.l = new RowCollection(this, this.k);
      this.n = new PageSetup(this.m, this.m);
      this.y = new ColumnCollection(this.m, var3);
      this.m();
      this.l();
   }

   PageSetup i() {
      return this.n;
   }

   public ArrayList getMergedCells() {
      ArrayList var1 = this.i.a();
      return var1;
   }

   void j() {
      if (this.i != null && this.i.getCount() >= 1) {
         for(int var1 = 0; var1 < this.i.getCount() - 1; ++var1) {
            CellArea var2 = this.i.a(var1);

            for(int var3 = this.i.getCount() - 1; var3 > var1; --var3) {
               CellArea var4 = this.i.a(var3);
               if (zayd.e(var2, var4) != null) {
                  if (!this.r().n().k() && !zayd.a(var2, var4)) {
                     var2 = zayd.c(var2, var4);
                     this.i.removeAt(var3);
                     var3 = this.i.getCount();
                  } else {
                     this.i.removeAt(var3);
                  }
               }
            }

            this.i.a(var1, var2);
         }

      }
   }

   void k() {
      this.r().n().b();
      Column var1 = null;

      int var2;
      for(var2 = this.y.getCount() - 1; var2 >= 0; --var2) {
         var1 = this.y.getColumnByIndex(var2);
         if (var1.getIndex() <= 255) {
            break;
         }

         this.y.removeAt(var2);
      }

      this.n();
      this.l.d.a();
      var2 = this.f().b(65536);
      if (var2 < 0) {
         var2 = -var2 - 1;
      }

      this.f().d(var2, -1);
      if (this.e > 255) {
         zahl var3 = this.f().b();
         zp var4 = null;

         while(true) {
            var2 = var3.a();
            if (var2 < 0) {
               this.e = 255;
               break;
            }

            var4 = this.f().f(var2);
            var2 = var4.b(256);
            if (var2 < 0) {
               var2 = -var2 - 1;
            }

            var4.d(var2, -1);
         }
      }

      if (this.i != null) {
         this.i.b();
      }

      int var11;
      if (this.g != null && this.g.getCount() > 0) {
         for(var11 = this.g.getCount() - 1; var11 >= 0; --var11) {
            HorizontalPageBreak var12 = this.g.get(var11);
            if (var12.getRow() <= 65535 && var12.getStartColumn() <= 255) {
               if (var12.getEndColumn() > 255) {
                  var12.b(255);
               }
            } else {
               this.g.removeAt(var11);
            }
         }
      }

      if (this.h != null && this.h.getCount() > 0) {
         for(var11 = this.h.getCount() - 1; var11 >= 0; --var11) {
            VerticalPageBreak var14 = this.h.get(var11);
            if (var14.getColumn() <= 255 && var14.getStartRow() <= 65535) {
               if (var14.getEndRow() > 65535) {
                  var14.b(65535);
               }
            } else {
               this.h.removeAt(var11);
            }
         }
      }

      if (this.m.getListObjects().getCount() != 0) {
         ListObjectCollection var13 = this.m.getListObjects();

         for(int var15 = 0; var15 < var13.getCount(); ++var15) {
            ListObject var5 = var13.get(var15);
            if (var5.getStartRow() <= 65535 && var5.getStartColumn() <= 255 && var5.getEndRow() <= 65535 && var5.getEndColumn() <= 255) {
               for(int var6 = var5.getStartRow(); var6 <= var5.getEndRow(); ++var6) {
                  Row var7 = this.checkRow(var6);
                  if (var7 != null) {
                     for(int var8 = var5.getStartColumn(); var8 <= var5.getEndColumn(); ++var8) {
                        Cell var9 = var7.getCellOrNull(var8);
                        if (var9 != null && var9.f()) {
                           byte[] var10 = var9.v();
                           var10 = zyo.a(var10, -1, -1, (Worksheet)this.m);
                           var9.a(var10);
                        }
                     }
                  }
               }
            } else {
               var13.removeAt(var15--);
            }
         }
      }

   }

   void l() {
      this.c = new zku(this);
   }

   void m() {
      this.d = new zks(this);
   }

   /** @deprecated */
   public Cell getCell(int row, int column) {
      return this.get(row, column);
   }

   /** @deprecated */
   public Row getRow(int row) {
      return this.getRows().get(row);
   }

   /** @deprecated */
   public Column getColumn(int columnIndex) {
      return this.getColumns().get(columnIndex);
   }

   public Cell checkCell(int row, int column) {
      return this.l.a.a(row, column);
   }

   public Row checkRow(int row) {
      return this.l.a.b(row);
   }

   public Column checkColumn(int columnIndex) {
      return this.getColumns().c(columnIndex);
   }

   public boolean isRowHidden(int rowIndex) {
      Row var2 = this.l.a.b(rowIndex);
      return var2 == null ? false : var2.isHidden();
   }

   public boolean isColumnHidden(int columnIndex) {
      Column var2 = this.getColumns().c(columnIndex);
      return var2 == null ? this.getColumns().b(columnIndex) : var2.isHidden();
   }

   public void addRange(Range rangeObject) {
      this.B.a(rangeObject);
   }

   public Range createRange(String upperLeftCell, String lowerRightCell) {
      byte var3 = 0;
      byte var4 = 0;
      byte var5 = 0;
      byte var6 = 0;
      int[] var7 = new int[]{var3};
      int[] var8 = new int[]{var5};
      CellsHelper.a(upperLeftCell, var7, var8);
      int var11 = var7[0];
      int var13 = var8[0];
      int[] var9 = new int[]{var4};
      int[] var10 = new int[]{var6};
      CellsHelper.a(lowerRightCell, var9, var10);
      int var12 = var9[0];
      int var14 = var10[0];
      if (var11 <= var12 && var13 <= var14) {
         return this.createRange(var11, var13, var12 - var11 + 1, var14 - var13 + 1);
      } else {
         throw new IllegalArgumentException("The row and column index of upper left cell should be no more than lower right cell.");
      }
   }

   public Range createRange(int firstRow, int firstColumn, int totalRows, int totalColumns) {
      if (totalRows != 0 && totalColumns != 0) {
         zakq.a(firstRow, firstColumn, firstRow + totalRows - 1, firstColumn + totalColumns - 1);
         Range var5 = new Range(firstRow, firstColumn, totalRows, totalColumns, this);
         return var5;
      } else {
         throw new IllegalArgumentException("Row number or column number cannot be zero");
      }
   }

   public Range createRange(String address) {
      String var2 = address;
      int var3 = address.lastIndexOf(33);
      if (var3 != -1) {
         var2 = address.substring(var3 + 1);
      }

      var3 = var2.indexOf(58);
      if (var3 != -1) {
         String var9 = com.aspose.cells.b.a.zv.a(var2.substring(0, 0 + var3), "$", "");
         String var11 = com.aspose.cells.b.a.zv.a(var2.substring(var3 + 1), "$", "");
         int var12;
         int var13;
         if (Character.isDigit(var9.charAt(0))) {
            var12 = com.aspose.cells.b.a.zo.a(var9) - 1;
            var13 = com.aspose.cells.b.a.zo.a(var11) - 1;
            return this.createRange(var12, var13 - var12 + 1, false);
         } else if (Character.isDigit(var9.charAt(var9.length() - 1))) {
            return this.createRange(var9, var11);
         } else {
            var12 = CellsHelper.columnNameToIndex(var9);
            var13 = CellsHelper.columnNameToIndex(var11);
            return this.createRange(var12, var13 - var12 + 1, true);
         }
      } else {
         var2 = com.aspose.cells.b.a.zv.a(var2, "$", "");
         byte var4 = 0;
         byte var5 = 0;
         int[] var6 = new int[]{var4};
         int[] var7 = new int[]{var5};
         CellsHelper.a(var2, var6, var7);
         int var8 = var6[0];
         int var10 = var7[0];
         return this.createRange(var8, var10, 1, 1);
      }
   }

   public Range createRange(int firstIndex, int number, boolean isVertical) {
      if (firstIndex >= 0 && number > 0) {
         Range var4;
         if (isVertical) {
            zakq.b(firstIndex + number - 1);
            var4 = new Range(0, firstIndex, 1048576, number, this);
            return var4;
         } else {
            zakq.a(firstIndex + number - 1);
            var4 = new Range(firstIndex, 0, number, 16384, this);
            return var4;
         }
      } else {
         throw new IllegalArgumentException();
      }
   }

   /** @deprecated */
   public Cell get(int index) {
      return this.a(index);
   }

   public Cell get(int row, int column) {
      zakq.a(row, column);
      return this.l.a(row, column, false, true, true);
   }

   public Cell get(String cellName) {
      byte var2 = 0;
      byte var3 = 0;
      int[] var4 = new int[]{var2};
      int[] var5 = new int[]{var3};
      CellsHelper.a(cellName, var4, var5);
      int var6 = var4[0];
      int var7 = var5[0];
      return this.l.a(var6, var7, false, true, true);
   }

   public boolean getMultiThreadReading() {
      return this.o;
   }

   public void setMultiThreadReading(boolean value) {
      if (this.o != value) {
         this.o = value;
         this.k.a(value);
         this.l.a(this.k);
      }

   }

   public int getMemorySetting() {
      return this.k.c() ? 1 : 0;
   }

   public void setMemorySetting(int value) {
      switch(value) {
      case 0:
         if (!this.k.c()) {
            return;
         }
         break;
      case 1:
         if (this.k.c()) {
            return;
         }
      }

      this.n();
      this.l.d.a();
      zr var2 = this.k;
      int var3 = var2.a();
      if (var3 > 0) {
         this.k = this.a(value, var3, 128, 1, 16);
         this.k.a(-1, var2, -1, var3, false);
         var2.e(0);
      } else {
         this.k = this.a(value, 128, 128, 16, 16);
      }

      this.l.a(this.k);
   }

   void n() {
      this.v = -1;
      this.p = -1;
      this.q = -1;
      this.t = null;
   }

   Cell a(int var1) {
      if (var1 >= 0 && var1 < this.getCount()) {
         if (this.q < 0) {
            this.u = var1;
            return this.f(var1);
         } else {
            int var2 = this.f().b(this.q, this.p);
            if (var2 != this.p) {
               this.u = var1;
               return this.f(var1);
            } else {
               var2 = this.t.a.b(this.s, this.r);
               if (var2 != this.r) {
                  this.u = var1;
                  return this.f(var1);
               } else if (var1 == this.u) {
                  return this.t.a(this.r);
               } else {
                  zahl var3;
                  Cell var5;
                  if (var1 == this.u - 1) {
                     --this.u;
                     this.r = this.t.a.a(this.r, true);
                     if (this.r < 0) {
                        var3 = this.f().a(-1, this.p, true);
                        var3.a();
                        return this.a(var3, 0, true);
                     } else {
                        var5 = this.t.a(this.r);
                        this.s = var5.getColumn();
                        return var5;
                     }
                  } else if (var1 == this.u + 1) {
                     ++this.u;
                     this.r = this.t.a.a(this.r, false);
                     if (this.r < 0) {
                        var3 = this.f().a(this.p, -1, false);
                        var3.a();
                        return this.a(var3, 0, false);
                     } else {
                        var5 = this.t.a(this.r);
                        this.s = var5.getColumn();
                        return var5;
                     }
                  } else {
                     Cell var4;
                     if (var1 < this.u) {
                        if (this.u - var1 > this.u / 2) {
                           this.u = var1;
                           return this.a(this.f().a(-1, -1, false), var1, false);
                        } else {
                           var3 = this.t.a.a(-1, this.r, true);
                           var3.a();

                           do {
                              this.r = var3.a();
                              if (this.r < 0) {
                                 var3 = this.f().a(-1, this.p, true);
                                 var3.a();
                                 var1 = this.u - var1 - 1;
                                 this.u = this.u - var1 - 1;
                                 return this.a(var3, var1, true);
                              }

                              --this.u;
                           } while(this.u != var1);

                           var4 = this.t.a(this.r);
                           this.s = var4.getColumn();
                           return var4;
                        }
                     } else if (var1 - this.u > (this.getCount() - this.u) / 2) {
                        this.u = var1;
                        return this.a(this.f().a(-1, -1, true), this.getCount() - var1 - 1, true);
                     } else {
                        var3 = this.t.a.a(this.r, -1, false);
                        var3.a();

                        do {
                           this.r = var3.a();
                           if (this.r < 0) {
                              var3 = this.f().a(-1, this.p, false);
                              var3.a();
                              var1 = var1 - this.u - 1;
                              this.u = this.u + var1 + 1;
                              return this.a(var3, var1, false);
                           }

                           ++this.u;
                        } while(this.u != var1);

                        var4 = this.t.a(this.r);
                        this.s = var4.getColumn();
                        return var4;
                     }
                  }
               }
            }
         }
      } else {
         return null;
      }
   }

   private Cell f(int var1) {
      return var1 < (this.getCount() + 1) / 2 ? this.a(this.f().a(-1, -1, false), var1, false) : this.a(this.f().a(-1, -1, true), this.getCount() - var1 - 1, true);
   }

   private Cell a(zahl var1, int var2) {
      while(true) {
         --var2;
         if (var2 < 0) {
            this.q = this.t.getIndex();
            this.r = var1.a();
            Cell var3 = this.t.a(this.r);
            this.s = var3.getColumn();
            return var3;
         }

         var1.a();
      }
   }

   private Cell a(zahl var1, int var2, boolean var3) {
      int var4 = var2;

      while(true) {
         this.p = var1.a();
         if (this.p < 0) {
            this.v -= var4 + 1;
            this.n();
            return null;
         }

         this.t = this.l.b(this.p, false);
         int var5 = this.t.a.a();
         if (var4 < var5) {
            return this.a(this.t.a.a(-1, -1, var3), var4);
         }

         var4 -= var5;
      }
   }

   Cell a(int var1, int var2, boolean var3) {
      return this.l.a(var1, var2, var3, true, true);
   }

   public void clear() {
      this.l.clear();
   }

   public double getStandardWidthInch() {
      return (double)((float)this.getStandardWidthPixels() * 1.0F / (float)this.r().L());
   }

   public void setStandardWidthInch(double value) {
      this.setStandardWidthPixels((int)(value * (double)this.r().L() + 0.5D));
   }

   public int getStandardWidthPixels() {
      double var1 = this.getColumns().b();
      return zkp.b(var1, this.r());
   }

   public void setStandardWidthPixels(int value) {
      this.a(zkp.a(this.m, (double)value, this.r()));
   }

   public double getStandardWidth() {
      return this.getColumns().b();
   }

   public void setStandardWidth(double value) {
      if (value >= 0.0D && value < 256.0D) {
         int var3 = zkp.b(value, this.r());
         double var4 = zkp.a((double)var3, this.r());
         this.a(var4);
      }

   }

   void a(double var1) {
      this.w = true;
      this.y.a(var1);
   }

   boolean o() {
      return this.w;
   }

   int p() {
      return (this.x & 255 & 1) != 0 ? (int)this.a : (int)(Math.ceil(this.a / 1440.0D * (double)this.r().L()) * 1440.0D / (double)this.r().L());
   }

   public double getStandardHeight() {
      return (this.x & 255 & 1) != 0 ? this.a / 20.0D : Math.ceil(this.a / 20.0D * (double)this.r().L() / 72.0D) * 72.0D / (double)this.r().L();
   }

   public void setStandardHeight(double value) {
      if (value <= 409.5D && value >= 0.0D) {
         this.a = (double)((int)(value * 20.0D + 0.5D));
         this.l.a(this.a, false);
         this.x = (byte)(this.x | 1);
      }

   }

   public int getStandardHeightPixels() {
      return (int)(this.getStandardHeight() * (double)this.r().M() / 72.0D + 0.5D);
   }

   public void setStandardHeightPixels(int value) {
      this.setStandardHeight((double)((float)value * 72.0F / (float)this.r().M()));
   }

   public int importData(ICellsDataTable table, int firstRow, int firstColumn, ImportTableOptions options) {
      return zakc.a(table, this, firstRow, firstColumn, options);
   }

   public void importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn) {
      this.importTwoDimensionArray(objArray, firstRow, firstColumn, false);
   }

   public void importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn, boolean convertStringToNumber) {
      this.importTwoDimensionArray(objArray, (Object[][])null, firstRow, firstColumn, convertStringToNumber);
   }

   public void importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, boolean convertStringToNumber) {
      TxtLoadOptions var6 = new TxtLoadOptions();
      var6.setConvertDateTimeData(convertStringToNumber);
      var6.setConvertNumericData(convertStringToNumber);
      var6.setLoadStyleStrategy(0);
      this.importTwoDimensionArray(objArray, styles, firstRow, firstColumn, var6);
   }

   public void importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, TxtLoadOptions opts) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var6 = com.aspose.cells.a.c.zc.a((Object[][])objArray, 0);
            int var7 = com.aspose.cells.a.c.zc.a((Object[][])objArray, 1);
            if (var6 + firstRow > 1048575) {
               var6 = 1048575 - firstRow;
            }

            if (var7 + firstColumn > 16383) {
               var7 = 16383 - firstColumn;
            }

            zhm var8;
            boolean var10;
            if (opts.getConvertNumericData()) {
               var8 = this.m.getWorkbook().getSettings().e().h();
               var10 = true;
            } else {
               var8 = null;
               var10 = false;
            }

            zhb var9;
            boolean var11;
            boolean var12;
            if (opts.getConvertDateTimeData()) {
               var9 = this.m.getWorkbook().getSettings().e().i();
               var11 = this.m.getWorkbook().getSettings().getDate1904();
               var12 = true;
            } else {
               var9 = null;
               var11 = false;
               var12 = false;
            }

            zati var13 = null;
            zfv var15 = new zfv();
            zbvx var16 = this.m.c().B();
            boolean var17 = styles != null;
            Style var18 = null;

            for(int var19 = 0; var19 <= var6; ++var19) {
               Row var20 = this.getRows().a(var19 + firstRow, false, false, false);
               int var21 = var20.d();

               for(int var22 = 0; var22 <= var7; ++var22) {
                  Cell var23 = var20.a(firstColumn + var22, false, true);
                  if (var17 && styles[var19][var22] != null) {
                     var18 = (Style)styles[var19][var22];
                  } else {
                     var18 = null;
                  }

                  if (objArray[var19][var22] instanceof String) {
                     String var24 = (String)objArray[var19][var22];
                     if (var24.startsWith("=")) {
                        var23.setFormula(var24);
                     } else {
                        boolean var14 = false;
                        if (!"".equals(var24) && var24.length() < 30 && (var10 || var12)) {
                           boolean var25 = true;
                           if (opts.getLoadStyleStrategy() != 2) {
                              Style var26 = var23.p();
                              String var27 = var26.getCustom();
                              if (var27 != null && !"".equals(var27)) {
                                 if (zyc.a(var27)) {
                                    var25 = false;
                                 }
                              } else {
                                 int var28 = zxx.b(var26.getNumber());
                                 if (var28 == 1) {
                                    var25 = false;
                                 }
                              }
                           }

                           if (var25) {
                              if (var10 && var8.parseObject(var24) != null) {
                                 var14 = true;
                                 var13 = var8.a();
                              } else if (var12 && var9.parseObject(var24) != null) {
                                 var14 = true;
                                 var13 = var9.a();
                              }
                           }
                        }

                        if (var14) {
                           String var30 = var13.e();
                           int var31 = -1;
                           if (var13.a() == 1) {
                              DateTime var32 = (DateTime)var13.d();
                              double var34 = zbtq.a(var32, var11);
                              if (var34 < 0.0D) {
                                 var14 = false;
                              } else {
                                 if (opts.getLoadStyleStrategy() == 1 && var18 == null) {
                                    var31 = var13.b();
                                 }

                                 zavz.a(var34, var15);
                              }
                           } else if (var13.a() == 4) {
                              zatj var33 = (zatj)var13;
                              zavz.a(var33.i(), var15);
                              if (opts.getLoadStyleStrategy() == 1 && var18 == null) {
                                 var31 = var13.b();
                              }
                           }

                           if (var14) {
                              if (opts.getLoadStyleStrategy() == 0) {
                                 var23.a(var15.c, var15.d, true);
                              } else {
                                 if (var18 == null) {
                                    var15.b = var16.a(var31, var30, var23.r());
                                 } else {
                                    var15.b = var16.c(var18);
                                 }

                                 var23.a((zfv)var15, 6, true);
                              }
                           }
                        }

                        if (!var14) {
                           var23.putValue(var24);
                           if (var18 != null) {
                              var23.b(var16.c(var18));
                           }
                        }
                     }
                  } else {
                     var23.putValue(objArray[var19][var22]);
                     if (var18 != null) {
                        var23.b(var16.c(var18));
                     }
                  }
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var5 = objArray.length;
            int var6;
            if (isVertical) {
               if (firstRow + var5 > 1048575) {
                  var5 = 1048575 - firstRow + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow + var6, firstColumn, false).putValue(objArray[var6]);
               }
            } else {
               if (firstColumn + var5 > 16383) {
                  var5 = 16383 - firstColumn + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow, firstColumn + var6, false).putValue(objArray[var6]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importArrayList(ArrayList arrayList, int firstRow, int firstColumn, boolean isVertical) {
      zakq.a(firstRow, firstColumn);
      this.r().n().b();
      int var5 = arrayList.size();
      int var6;
      if (isVertical) {
         if (firstRow + var5 > 1048575) {
            var5 = 1048575 - firstRow + 1;
         }

         for(var6 = 0; var6 < var5; ++var6) {
            this.a(firstRow + var6, firstColumn, false).putValue(arrayList.get(var6));
         }
      } else {
         if (firstColumn + var5 > 16383) {
            var5 = 16383 - firstColumn + 1;
         }

         for(var6 = 0; var6 < var5; ++var6) {
            this.a(firstRow, firstColumn + var6, false).putValue(arrayList.get(var6));
         }
      }

   }

   public void importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical, int skip) {
      this.r().n().b();
      if (firstRow >= 0 && skip >= 0) {
         int var6 = objArray.length;
         int var9;
         if (isVertical) {
            for(var9 = 0; var9 < var6; ++var9) {
               int var7 = firstRow + var9 * (skip + 1);
               if (var7 > 1048575) {
                  return;
               }

               this.a(var7, firstColumn, false).putValue(objArray[var9]);
            }
         } else {
            for(var9 = 0; var9 < var6; ++var9) {
               int var8 = firstColumn + var9 * (skip + 1);
               if (var8 > 16383) {
                  return;
               }

               this.a(firstRow, var8, false).putValue(objArray[var9]);
            }
         }

      } else {
         throw new IllegalArgumentException();
      }
   }

   public void importArray(String[][] stringArray, int firstRow, int firstColumn) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var4 = com.aspose.cells.a.c.zc.a((Object[][])stringArray, 0);
            int var5 = com.aspose.cells.a.c.zc.a((Object[][])stringArray, 1);
            if (var4 + firstRow > 1048575) {
               var4 = 1048575 - firstRow;
            }

            if (var5 + firstColumn > 16383) {
               var5 = 16383 - firstColumn;
            }

            for(int var6 = 0; var6 <= var4; ++var6) {
               for(int var7 = 0; var7 <= var5; ++var7) {
                  this.a(firstRow + var6, firstColumn + var7, false).putValue(stringArray[var6][var7]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importFormulaArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical) {
      this.r().n().b();
      int var5 = stringArray.length;
      int var6;
      if (isVertical) {
         if (firstRow + var5 > 1048575) {
            var5 = 1048575 - firstRow + 1;
         }

         for(var6 = 0; var6 < var5; ++var6) {
            this.a(firstRow + var6, firstColumn, false).setFormula(stringArray[var6]);
         }
      } else {
         if (firstColumn + var5 > 16383) {
            var5 = 16383 - firstColumn + 1;
         }

         for(var6 = 0; var6 < var5; ++var6) {
            this.a(firstRow, firstColumn + var6, false).setFormula(stringArray[var6]);
         }
      }

   }

   public void importArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var5 = stringArray.length;
            int var6;
            if (isVertical) {
               if (firstRow + var5 > 1048575) {
                  var5 = 1048575 - firstRow + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow + var6, firstColumn, false).putValue(stringArray[var6]);
               }
            } else {
               if (firstColumn + var5 > 16383) {
                  var5 = 16383 - firstColumn + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow, firstColumn + var6, false).putValue(stringArray[var6]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importArray(int[][] intArray, int firstRow, int firstColumn) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var4 = com.aspose.cells.a.c.zc.a((int[][])intArray, 0);
            int var5 = com.aspose.cells.a.c.zc.a((int[][])intArray, 1);
            if (var4 + firstRow > 1048575) {
               var4 = 1048575 - firstRow;
            }

            if (var5 + firstColumn > 16383) {
               var5 = 16383 - firstColumn;
            }

            for(int var6 = 0; var6 <= var4; ++var6) {
               for(int var7 = 0; var7 <= var5; ++var7) {
                  this.a(firstRow + var6, firstColumn + var7, false).putValue(intArray[var6][var7]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importArray(int[] intArray, int firstRow, int firstColumn, boolean isVertical) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var5 = intArray.length;
            int var6;
            if (isVertical) {
               if (firstRow + var5 > 1048575) {
                  var5 = 1048575 - firstRow + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow + var6, firstColumn, false).putValue(intArray[var6]);
               }
            } else {
               if (firstColumn + var5 > 16383) {
                  var5 = 16383 - firstColumn + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow, firstColumn + var6, false).putValue(intArray[var6]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importArray(double[][] doubleArray, int firstRow, int firstColumn) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var4 = com.aspose.cells.a.c.zc.a((double[][])doubleArray, 0);
            int var5 = com.aspose.cells.a.c.zc.a((double[][])doubleArray, 1);
            if (var4 + firstRow > 1048575) {
               var4 = 1048575 - firstRow;
            }

            if (var5 + firstColumn > 16383) {
               var5 = 16383 - firstColumn;
            }

            for(int var6 = 0; var6 <= var4; ++var6) {
               for(int var7 = 0; var7 <= var5; ++var7) {
                  this.a(firstRow + var6, firstColumn + var7, false).putValue(doubleArray[var6][var7]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importArray(double[] doubleArray, int firstRow, int firstColumn, boolean isVertical) {
      this.r().n().b();
      if (firstRow >= 0 && firstRow <= 1048575) {
         if (firstColumn >= 0 && firstColumn <= 16383) {
            int var5 = doubleArray.length;
            int var6;
            if (isVertical) {
               if (firstRow + var5 > 1048575) {
                  var5 = 1048575 - firstRow + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow + var6, firstColumn, false).putValue(doubleArray[var6]);
               }
            } else {
               if (firstColumn + var5 > 16383) {
                  var5 = 16383 - firstColumn + 1;
               }

               for(var6 = 0; var6 < var5; ++var6) {
                  this.a(firstRow, firstColumn + var6, false).putValue(doubleArray[var6]);
               }
            }

         } else {
            throw new IllegalArgumentException("First column index is out of range.");
         }
      } else {
         throw new IllegalArgumentException("First row index is out of range.");
      }
   }

   public void importCSV(String fileName, String spliter, boolean convertNumericData, int firstRow, int firstColumn) throws Exception {
      TxtLoadOptions var6 = new TxtLoadOptions();
      var6.setSeparatorString(spliter);
      var6.setConvertNumericData(convertNumericData);
      var6.setConvertDateTimeData(convertNumericData);
      if (!this.r().n().getSettings().i) {
         var6.setEncoding(this.r().n().getSettings().f());
      }

      zbvi.a(fileName, this, firstRow, firstColumn, var6);
   }

   void a(com.aspose.cells.b.a.d.zm var1, String var2, boolean var3, int var4, int var5) throws Exception {
      TxtLoadOptions var6 = new TxtLoadOptions();
      var6.setSeparatorString(var2);
      var6.setConvertNumericData(var3);
      var6.setConvertDateTimeData(var3);
      com.aspose.cells.b.a.d.zn var7;
      if (this.r().n().getSettings().i) {
         var7 = new com.aspose.cells.b.a.d.zn(var1);
      } else {
         var7 = new com.aspose.cells.b.a.d.zn(var1, this.r().n().getSettings().f());
         var6.setEncoding(this.r().n().getSettings().f());
      }

      zbvi.a(var7, this, var4, var5, var6);
   }

   public void importCSV(InputStream stream, String spliter, boolean convertNumericData, int firstRow, int firstColumn) throws Exception {
      com.aspose.cells.b.a.d.zh var6 = new com.aspose.cells.b.a.d.zh(stream);
      this.a(var6, spliter, convertNumericData, firstRow, firstColumn);
   }

   public void importCSV(String fileName, TxtLoadOptions options, int firstRow, int firstColumn) throws Exception {
      zbvi.a(fileName, this, firstRow, firstColumn, options);
   }

   void a(com.aspose.cells.b.a.d.zm var1, TxtLoadOptions var2, int var3, int var4) throws Exception {
      com.aspose.cells.b.a.d.zn var5;
      if (var2.d) {
         var5 = new com.aspose.cells.b.a.d.zn(var1);
      } else {
         var5 = new com.aspose.cells.b.a.d.zn(var1, var2.getEncoding());
      }

      zbvi.a(var5, this, var3, var4, var2);
   }

   public void importCSV(InputStream stream, TxtLoadOptions options, int firstRow, int firstColumn) throws Exception {
      com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh(stream);
      this.a(var5, options, firstRow, firstColumn);
   }

   public boolean getPreserveString() {
      return this.f;
   }

   public void setPreserveString(boolean value) {
      this.f = value;
   }

   public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns) {
      this.i.a(this, firstRow, firstColumn, totalRows, totalColumns);
   }

   public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean mergeConflict) {
      this.i.a(this, firstRow, firstColumn, totalRows, totalColumns, true, mergeConflict);
   }

   public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean checkConflict, boolean mergeConflict) {
      this.i.a(this, firstRow, firstColumn, totalRows, totalColumns, checkConflict, mergeConflict);
   }

   public void unMerge(int firstRow, int firstColumn, int totalRows, int totalColumns) {
      this.i.a(firstRow, firstColumn, totalRows, totalColumns);
   }

   public void hideRow(int row) {
      this.setRowHeight(row, 0.0D);
   }

   public void unhideRow(int row, double height) {
      int var4 = this.l.e(row);
      if (var4 > -1) {
         byte var5 = this.k.k(var4, 0);
         if (zbbj.c(var5)) {
            this.k.a(var4, 0, zbbj.b(var5, false));
         }
      }

   }

   public void hideRows(int row, int totalRows) {
      for(int var3 = 0; var3 < totalRows; ++var3) {
         this.getRows().a(row + var3, false, false, false).setHidden(true);
      }

   }

   public void unhideRows(int row, int totalRows, double height) {
      if (totalRows == 1) {
         this.unhideRow(row, height);
      } else {
         zahl var5 = this.k.b(row, row + totalRows - 1, false);
         if (var5 != null) {
            int var6;
            if (height > 0.0D) {
               short var11 = (short)((int)(height * 20.0D + 0.5D));
               byte var8 = 5;
               zbbj var9 = new zbbj();

               while(true) {
                  var6 = var5.a();
                  if (var6 < 0) {
                     return;
                  }

                  zbbj var10 = this.k.b(var6, var9, 1);
                  if (var10.b()) {
                     var10.b(false);
                     var10.e = var11;
                     this.k.c(var6, var10, var8);
                  }
               }
            } else {
               while(true) {
                  var6 = var5.a();
                  if (var6 < 0) {
                     return;
                  }

                  byte var7 = this.k.k(var6, 0);
                  if (zbbj.c(var7)) {
                     this.k.a(var6, 0, zbbj.b(var7, false));
                  }
               }
            }
         }
      }
   }

   public void setRowHeightPixel(int row, int pixels) {
      double var3 = (double)((float)pixels * 72.0F / (float)this.r().L());
      this.setRowHeight(row, var3);
   }

   public void setRowHeightInch(int row, double inches) {
      this.setRowHeight(row, inches * 72.0D);
   }

   public void setRowHeight(int row, double height) {
      if (height >= 0.0D && height <= 409.5D) {
         int var4 = (int)(height * 20.0D + 0.5D);
         Row var6 = this.l.a(row, false, true, false);
         var6.f(var4);
         if (height != 0.0D) {
            var6.setHeightMatched(false);
         } else {
            var6.setHeightMatched(true);
         }

      } else {
         throw new CellsException(6, "Row height must be between 0 and 409.");
      }
   }

   public double getRowHeight(int row) {
      zakq.a(row);
      return this.l.b.b(row);
   }

   int b(int var1) {
      if (var1 >= 0 && var1 <= 1048575) {
         int var2 = this.l.e(var1);
         return var2 < 0 ? (int)(this.getStandardHeight() * (double)this.r().M() / 72.0D) : (int)(Row.a(this.k, var2) * (double)this.r().M() / 72.0D);
      } else {
         return (int)(this.getStandardHeight() * (double)this.r().M() / 72.0D);
      }
   }

   public void hideColumn(int column) {
      this.getColumns().get(column).setHidden(true);
   }

   public void unhideColumn(int column, double width) {
      this.unhideColumns(column, 1, width);
   }

   public void hideColumns(int column, int totalColumns) {
      for(int var3 = 0; var3 < totalColumns; ++var3) {
         this.getColumns().get(var3 + column).setHidden(true);
      }

   }

   public void unhideColumns(int column, int totlaColumns, double width) {
      int var5;
      if (width > 0.0D) {
         var5 = this.r().I();
         int var6 = (int)((double)this.r().H() / 256.0D * (double)var5 + 0.5D);
         int var7;
         if (width >= 1.0D) {
            var7 = (int)((width + 1.0D) * (double)var5 + (double)var6 + 0.5D);
            width = (double)((int)((double)(var7 - var6 - var5) * 100.0D / (double)var5 + 0.5D)) / 100.0D;
         } else {
            var7 = (int)(width * (double)(var5 + var6) + 0.5D);
            width = (double)((int)((double)var7 * 100.0D / (double)(var5 + var6) + 0.5D)) / 100.0D;
         }
      }

      for(var5 = 0; var5 < totlaColumns; ++var5) {
         boolean var8 = this.y.b(column + var5);
         Column var9;
         if (var8) {
            var9 = this.y.get(column + var5);
            var9.setHidden(false);
            if (width > 0.0D) {
               var9.setWidth(width);
            } else if (var9.a == 0.0D) {
               var9.a = this.getStandardWidth();
            }
         } else {
            var9 = this.y.c(column + var5);
            if (var9 != null && var9.isHidden()) {
               var9.setHidden(false);
               if (width > 0.0D) {
                  var9.setWidth(width);
               } else if (var9.a == 0.0D) {
                  var9.a = this.getStandardWidth();
               }
            }
         }
      }

   }

   public int getRowHeightPixel(int row) {
      zakq.a(row);
      return this.l.b.a(row);
   }

   public double getRowHeightInch(int row) {
      zakq.a(row);
      return this.l.b.c(row);
   }

   public void setColumnWidthPixel(int column, int pixel) {
      this.setColumnWidth(column, zkp.a(this.m, (double)pixel, this.r()));
   }

   public void setColumnWidthInch(int column, double inches) {
      this.setColumnWidthPixel(column, (int)((double)this.r().L() * inches + 0.5D));
   }

   public void setColumnWidth(int column, double width) {
      if (width <= 255.0D && width >= 0.0D) {
         int var4 = zkp.b(width, this.r());
         width = zkp.a((double)var4, this.r());
         Column var5 = this.y.get(column);
         var5.setWidth(width);
      } else {
         throw new CellsException(6, "Column width must be between 0 and 255");
      }
   }

   int c(int var1) {
      zakq.b(var1);
      double var2 = this.getColumns().a(var1, true);
      int var4 = this.y.e(var1);
      if (var4 > -1) {
         Column var5 = this.y.getColumnByIndex(var4);
         var2 = var5.getWidth();
      }

      return zkp.b(var2, this.r());
   }

   public int getViewColumnWidthPixel(int column) {
      double var2 = this.getColumnWidth(column);
      int var4 = zkp.a(var2, this.m);
      return var4;
   }

   public int getColumnWidthPixel(int column) {
      zakq.b(column);
      return this.c.a(column);
   }

   public double getColumnWidthInch(int column) {
      zakq.b(column);
      return this.c.b(column);
   }

   public double getColumnWidth(int column) {
      zakq.b(column);
      int var2 = this.y.e(column);
      if (var2 > -1) {
         Column var3 = this.y.getColumnByIndex(var2);
         return var3.isHidden() ? 0.0D : var3.getWidth();
      } else {
         return this.getColumns().a(column, false);
      }
   }

   zani q() {
      return this.i;
   }

   WorksheetCollection r() {
      return this.m.c();
   }

   public int getMinRow() {
      zahl var1 = this.k.a(-1, -1, false);

      zp var2;
      do {
         int var3 = var1.a();
         if (var3 < 0) {
            return 0;
         }

         var2 = this.k.f(var3);
      } while(var2.a() <= 0);

      return var2.h();
   }

   public int getMaxRow() {
      return this.l.a.a();
   }

   public int getMinColumn() {
      int var1 = -1;
      zahl var2 = this.k.a(-1, -1, false);

      while(true) {
         int var5;
         do {
            zp var3;
            do {
               int var4 = var2.a();
               if (var4 < 0) {
                  return var1 < 0 ? 0 : var1;
               }

               var3 = this.k.f(var4);
            } while(var3.a() <= 0);

            var5 = var3.a(var3.a(-1, false));
            if (var5 == 0) {
               return 0;
            }
         } while(var5 >= var1 && var1 >= 0);

         var1 = var5;
      }
   }

   public int getMaxColumn() {
      return this.e;
   }

   public int getMinDataRow() {
      zahl var1 = this.k.a(-1, -1, false);

      label21:
      while(true) {
         int var4 = var1.a();
         if (var4 < 0) {
            return -1;
         }

         zp var3 = this.k.f(var4);
         zahl var2 = var3.b();

         do {
            var4 = var2.a();
            if (var4 < 0) {
               continue label21;
            }
         } while(var3.h(var4) == 0);

         return var3.h();
      }
   }

   public int getMaxDataRow() {
      return this.l.a.a_();
   }

   public int getMinDataColumn() {
      int var1 = Integer.MAX_VALUE;
      zahl var2 = this.k.b();

      while(true) {
         label33:
         while(true) {
            int var5 = var2.a();
            if (var5 < 0) {
               if (var1 == Integer.MAX_VALUE) {
                  return -1;
               }

               return var1;
            }

            zp var4 = this.k.f(var5);
            zahl var3 = var4.a(-1, -1, false);

            int var6;
            do {
               var5 = var3.a();
               if (var5 < 0) {
                  continue label33;
               }

               var6 = var4.a(var5);
               if (var6 > var1) {
                  continue label33;
               }
            } while(var4.h(var5) == 0);

            if (var6 == 0) {
               return 0;
            }

            var1 = var6;
         }
      }
   }

   public int getMaxDataColumn() {
      int var1 = -1;
      zahl var2 = this.k.b();

      while(true) {
         label25:
         while(true) {
            int var5 = var2.a();
            if (var5 < 0) {
               return var1;
            }

            zp var4 = this.k.f(var5);
            zahl var3 = var4.a(-1, -1, true);

            int var6;
            do {
               var5 = var3.a();
               if (var5 < 0) {
                  continue label25;
               }

               var6 = var4.a(var5);
               if (var6 < var1) {
                  continue label25;
               }
            } while(var4.h(var5) == 0);

            var1 = var6;
         }
      }
   }

   /** @deprecated */
   public int maxDataRowInColumn(int column) {
      return this.getLastDataRow(column);
   }

   public int getLastDataRow(int column) {
      if (this.k.a() > 0) {
         zahl var2 = this.k.a(-1, -1, true);

         while(true) {
            int var3 = var2.a();
            if (var3 < 0) {
               break;
            }

            zp var4 = this.k.f(var3);
            if (var4.a() > 0) {
               var3 = var4.b(column);
               if (var3 > -1 && var4.h(var3) != 0) {
                  return var4.h();
               }
            }
         }
      }

      return 0;
   }

   int d(int var1) {
      int var2 = this.l.a.a();
      return var2 < 0 ? var1 : var2;
   }

   void a(short var1) {
      this.e = var1;
   }

   int b(short var1) {
      return this.e < 0 ? var1 : this.e;
   }

   byte s() {
      return this.x;
   }

   void a(byte var1) {
      this.x = var1;
   }

   public boolean isDefaultRowHeightMatched() {
      return (this.x & 255 & 1) == 0;
   }

   public void setDefaultRowHeightMatched(boolean value) {
      if (!value) {
         this.x = (byte)(this.x | 1);
      } else {
         this.x = (byte)(this.x & 254);
      }

   }

   boolean t() {
      return (this.x & 255 & 2) != 0;
   }

   void a(boolean var1) {
      if (var1) {
         this.x = (byte)(this.x | 2);
      } else {
         this.x = (byte)(this.x & 254);
      }

   }

   public ColumnCollection getColumns() {
      return this.y;
   }

   byte u() {
      return this.z;
   }

   void b(byte var1) {
      this.z = var1;
   }

   byte v() {
      return this.A;
   }

   void c(byte var1) {
      this.A = var1;
   }

   public void applyColumnStyle(int column, Style style, StyleFlag flag) {
      this.getColumns().get(column).applyStyle(style, flag);
   }

   public void applyRowStyle(int row, Style style, StyleFlag flag) {
      zakq.a(row);
      this.getRows().a(row, false, true, false).applyStyle(style, flag);
   }

   public void applyStyle(Style style, StyleFlag flag) {
      Column var3 = null;
      if (this.y.b == null) {
         var3 = this.y.b = new Column(0, this.m, this.y.b());
      } else {
         var3 = this.y.b;
         int var4 = this.y.b.getIndex();
         if (this.y.getCount() != 0) {
            for(int var5 = 0; var5 <= var4; ++var5) {
               this.y.get(var5);
            }
         }
      }

      zahl var15 = this.k.b();
      zp var6;
      int var7;
      int var8;
      int var9;
      zahl var16;
      if (flag.getAll()) {
         var9 = this.r().a(style);
         var3.c(var9);

         for(int var17 = 0; var17 < this.y.getCount(); ++var17) {
            this.y.getColumnByIndex(var17).c(var9);
         }

         while(true) {
            var7 = var15.a();
            if (var7 < 0) {
               return;
            }

            var6 = this.k.f(var7);
            var6.k(var9);
            var16 = var6.b();

            while(true) {
               var8 = var16.a();
               if (var8 < 0) {
                  break;
               }

               var6.j(var8, var9);
               if (var6.h(var8) == 4) {
                  zayy var18 = (zayy)var6.i(var8);
                  if (var18.f()) {
                     this.r().g.b(var18);
                     var6.k(var8, this.r().g.a(var18.c).e);
                  }
               }
            }
         }
      } else {
         HashMap var10 = new HashMap();
         boolean var11 = false;
         Style var12 = var3.getStyle();
         zakq.a(style, var12, flag);
         int var19 = var3.c();
         var3.c(this.r().a(var12));
         var10.put(var19, var3.c());

         for(int var20 = 0; var20 < this.y.getCount(); ++var20) {
            Column var13 = this.y.getColumnByIndex(var20);
            if (var10.get(var13.c()) != null) {
               var13.c((Integer)var10.get(var13.c()));
            } else {
               Style var14 = var13.getStyle();
               zakq.a(style, var14, flag);
               var19 = var13.c();
               var13.c(this.r().a(var14));
               var10.put(var19, var13.c());
            }
         }

         while(true) {
            var7 = var15.a();
            if (var7 < 0) {
               return;
            }

            var6 = this.k.f(var7);
            var9 = Row.e(var6);
            if (var10.get(var9) != null) {
               var6.k((Integer)var10.get(var9));
            } else {
               var12 = Row.a(this, var6);
               zakq.a(style, var12, flag);
               var19 = var9;
               var9 = this.r().a(var12);
               var6.k(var9);
               var10.put(var19, var9);
            }

            var16 = var6.b();

            while(true) {
               var8 = var16.a();
               if (var8 < 0) {
                  break;
               }

               if (var6.h(var8) == 4) {
                  zayy var21 = (zayy)var6.i(var8);
                  if (var21.f()) {
                     ((zbap)var21).a(this, style, flag);
                  }
               }

               var9 = var6.g(var8);
               if (var10.get(var9) != null) {
                  var6.j(var8, (Integer)var10.get(var9));
               } else {
                  var12 = Cell.b(this, var6, var8);
                  zakq.a(style, var12, flag);
                  var19 = var9;
                  var9 = this.r().a(var12);
                  var6.j(var8, var9);
                  var10.put(var19, var9);
               }
            }
         }
      }
   }

   public void copyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex) {
      this.copyColumns(sourceCells, sourceColumnIndex, destinationColumnIndex, 1);
   }

   public void copyColumns(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex, int columnNumber) {
      this.r().n().b();
      zakq.b(sourceColumnIndex);
      zakq.b(destinationColumnIndex);
      if (sourceCells != this || sourceColumnIndex != destinationColumnIndex) {
         CopyOptions var5 = new CopyOptions(false);
         if (var5.i == null) {
            var5.a(sourceCells.m, this.m);
         }

         for(int var6 = 0; var6 < sourceCells.y.getCount(); ++var6) {
            Column var7 = sourceCells.y.getColumnByIndex(var6);
            if (var7.getIndex() >= sourceColumnIndex) {
               if (var7.getIndex() >= sourceColumnIndex + columnNumber) {
                  break;
               }

               Column var8 = this.y.get(destinationColumnIndex + var7.getIndex() - sourceColumnIndex);
               var8.a(var7);
            }
         }

         this.l.b(sourceCells.l, sourceColumnIndex, destinationColumnIndex, columnNumber);
         this.i.a(sourceCells.i, sourceColumnIndex, destinationColumnIndex, columnNumber);
         this.m.e.a(sourceCells.m.e, sourceColumnIndex, destinationColumnIndex, columnNumber);
         if (sourceCells.m.getValidations().getCount() != 0) {
            this.m.getValidations().b(sourceCells.m.getValidations(), sourceColumnIndex, destinationColumnIndex, columnNumber, (CopyOptions)null);
         }

         if (sourceCells.m.getConditionalFormattings().getCount() != 0) {
            this.m.getConditionalFormattings().a(sourceCells.m.getConditionalFormattings(), sourceColumnIndex, destinationColumnIndex, columnNumber, var5, false);
         }

         if (sourceCells.m.getShapes().getCount() != 0) {
            this.m.getShapes().a(sourceCells.m.getShapes(), sourceColumnIndex, destinationColumnIndex, columnNumber);
         }

         this.m.getSparklineGroupCollection().a(sourceCells.m.getSparklineGroupCollection(), false, sourceColumnIndex, destinationColumnIndex, columnNumber, var5);
      }
   }

   public void copyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns) {
      int var6 = destinationTotalColumns;

      int var8;
      for(int var7 = destinationColumnIndex; var6 > 0; var6 -= var8) {
         var8 = var6 > sourceTotalColumns ? sourceTotalColumns : var6;
         this.copyColumns(sourceCells, sourceColumnIndex, var7, var8);
         var7 += var8;
      }

   }

   public void copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex) throws Exception {
      this.copyRows(sourceCells, sourceRowIndex, destinationRowIndex, 1);
   }

   public void copyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber) throws Exception {
      this.r().n().b();
      if (sourceRowIndex >= 0 && sourceRowIndex <= 1048575 && destinationRowIndex >= 0 && destinationRowIndex <= 1048575) {
         if (sourceCells != this || sourceRowIndex != destinationRowIndex) {
            CopyOptions var5 = new CopyOptions(false);
            if (var5.i == null) {
               var5.a(sourceCells.m, this.m);
            }

            this.l.a(sourceCells.getRows(), sourceRowIndex, destinationRowIndex, rowNumber);
            this.i.b(sourceCells.i, sourceRowIndex, destinationRowIndex, rowNumber);
            this.m.getHyperlinks().b(sourceCells.m.getHyperlinks(), sourceRowIndex, destinationRowIndex, rowNumber);
            if (sourceCells.m.getConditionalFormattings().getCount() != 0) {
               this.m.getConditionalFormattings().a(sourceCells.m.getConditionalFormattings(), sourceRowIndex, destinationRowIndex, rowNumber);
            }

            if (sourceCells.m.getValidations().getCount() != 0) {
               this.m.getValidations().a(sourceCells.m.getValidations(), sourceRowIndex, destinationRowIndex, rowNumber, (CopyOptions)null);
            }

            if (sourceCells.m.t() != null && sourceCells.m.t().getCount() != 0) {
               this.m.getShapes().b(sourceCells.m.t(), sourceRowIndex, destinationRowIndex, rowNumber);
            }

            if (sourceCells.m.getSparklineGroupCollection().getCount() != 0) {
               this.m.getSparklineGroupCollection().a(sourceCells.m.getSparklineGroupCollection(), true, sourceRowIndex, destinationRowIndex, rowNumber, var5);
            }

         }
      } else {
         throw new IllegalArgumentException("Row index is out of range.");
      }
   }

   void a(Cells var1, CopyOptions var2) {
      this.r().n().b();
      this.z = var1.z;
      this.A = var1.A;
      this.a = var1.a;
      this.x = var1.x;
      int var3 = var1.getRows().getCount() > 32 ? var1.getRows().getCount() : 32;
      this.k = this.a(var3, 10, 20, 5);
      this.l = new RowCollection(this, this.k);
      if (var2 != null) {
         boolean var4 = false;
         if (var2.a) {
            var4 = true;
         } else if (this.r() == var1.r()) {
            var4 = true;
         } else if (this.r().G().a(var1.r().G())) {
            var4 = true;
         }

         var2.e = var4;
      }

      this.l.a(var1.l, var2);
      this.y.a(var1.y, var2);
      if (var1.g.getCount() > 0) {
         this.g.a(var1.g);
      }

      this.w = var1.w;
      this.f = var1.f;
      if (var1.i.getCount() > 0) {
         this.i.a(var1.i);
      }

      this.n.a(var1.n, var2);
      if (var1.B.getCount() > 0) {
         for(int var7 = 0; var7 < var1.B.getCount(); ++var7) {
            Range var5 = var1.B.get(var7);
            Range var6 = new Range(var5.getFirstRow(), var5.getFirstColumn(), var5.getRowCount(), var5.getColumnCount(), this);
            var6.a(var5);
         }
      }

      if (var1.h.getCount() > 0) {
         this.h.a(var1.h);
      }

   }

   public int getGroupedRowOutlineLevel(int rowIndex) {
      Row var2 = this.l.a(rowIndex, true, false, false);
      return var2 == null ? 0 : var2.h();
   }

   public int getGroupedColumnOutlineLevel(int columnIndex) {
      int var2 = this.y.e(columnIndex);
      if (var2 < 0) {
         return 0;
      } else {
         Column var3 = this.y.getColumnByIndex(var2);
         return var3.b();
      }
   }

   public int getMaxGroupedColumnOutlineLevel() {
      return this.z;
   }

   public int getMaxGroupedRowOutlineLevel() {
      return this.A;
   }

   public void showGroupDetail(boolean isVertical, int index) {
      this.a(isVertical, index, false);
   }

   public void hideGroupDetail(boolean isVertical, int index) {
      this.a(isVertical, index, true);
   }

   private void a(boolean var1, int var2, boolean var3) {
      int var4;
      int var7;
      if (var1) {
         var4 = this.k.b(var2);
         if (var4 > -1) {
            zp var5 = this.k.f(var4);
            int var6 = Row.c(var5) & 255;
            if (var6 == 0) {
               return;
            }

            var7 = var2;
            zahl var8 = this.k.a(var4, -1, false);

            while(true) {
               var4 = var8.a();
               if (var4 < 0) {
                  break;
               }

               var5 = this.k.f(var4);
               if (var5.h() != var7 || (Row.c(var5) & 255) < var6) {
                  break;
               }

               Row.a(this, var5, var3);
               ++var7;
            }

            var4 = this.k.a(var4, true);
            if (var4 > 0) {
               var7 = var2 - 1;
               var8 = this.k.a(-1, var4, true);

               while(true) {
                  var4 = var8.a();
                  if (var4 < 0) {
                     break;
                  }

                  var5 = this.f().f(var4);
                  if (var5.h() != var7 || (Row.c(var5) & 255) < var6) {
                     break;
                  }

                  Row.a(this, var5, var3);
                  --var7;
               }
            }
         }
      } else {
         var4 = this.y.e(var2);
         if (var4 < 0) {
            return;
         }

         Column var9 = this.y.getColumnByIndex(var4);
         if (var9.b() == 0) {
            return;
         }

         Column var10 = null;

         for(var7 = var4; var7 < this.y.getCount(); ++var7) {
            var10 = this.y.getColumnByIndex(var7);
            if (var10.getIndex() != var9.getIndex() + var7 - var4 || (var9.b() & 255) > (var10.b() & 255)) {
               break;
            }

            var10.setHidden(var3);
         }

         for(var7 = var4 - 1; var7 >= 0; --var7) {
            var10 = this.y.getColumnByIndex(var7);
            if (var10.getIndex() != var9.getIndex() - (var4 - var7) || (var9.b() & 255) > (var10.b() & 255)) {
               break;
            }

            var10.setHidden(var3);
         }
      }

   }

   public void ungroupColumns(int firstIndex, int lastIndex) {
      int var3;
      int var4;
      Column var5;
      for(var3 = firstIndex; var3 <= lastIndex; ++var3) {
         var4 = this.y.e(var3);
         if (var4 > -1) {
            var5 = this.y.getColumnByIndex(var4);
            var5.a((byte)0);
         }
      }

      var3 = 0;

      for(var4 = 0; var4 < this.y.getCount(); ++var4) {
         var5 = this.y.getColumnByIndex(var4);
         if ((var5.b() & 255) > var3) {
            var3 = var5.b() & 255;
         }
      }

      this.z = (byte)var3;
   }

   public void groupColumns(int firstIndex, int lastIndex) {
      for(int var3 = firstIndex; var3 <= lastIndex; ++var3) {
         int var4 = this.y.e(var3);
         Column var5;
         if (var4 < 0) {
            var5 = this.y.a(var3, -var4 - 1);
            var5.c(15);
            var5.a((byte)1);
            if ((var5.b() & 255) > (this.z & 255)) {
               this.z = var5.b();
            }
         } else {
            var5 = this.y.getColumnByIndex(var4);
            if ((var5.b() & 255) < 7) {
               var5.a((byte)((var5.b() & 255) + 1));
            }

            if ((var5.b() & 255) > (this.z & 255)) {
               this.z = var5.b();
            }
         }
      }

   }

   public void groupColumns(int firstIndex, int lastIndex, boolean isHidden) {
      for(int var4 = firstIndex; var4 <= lastIndex; ++var4) {
         int var6 = this.y.e(var4);
         Column var5;
         if (var6 < 0) {
            var5 = this.y.a(var4, -var6 - 1);
            var5.c(15);
            var5.a((byte)1);
            var5.setHidden(isHidden);
            if ((var5.b() & 255) > (this.z & 255)) {
               this.z = var5.b();
            }
         } else {
            var5 = this.y.getColumnByIndex(var6);
            if ((var5.b() & 255) < 7) {
               var5.a((byte)((var5.b() & 255) + 1));
            }

            var5.setHidden(isHidden);
            if ((var5.b() & 255) > (this.z & 255)) {
               this.z = var5.b();
            }
         }

         if (isHidden) {
            if (var4 == lastIndex && this.m.getOutline().SummaryColumnRight) {
               var5.b(true);
               if (var4 < 16383) {
                  var6 = this.y.e(var4 + 1);
                  if (var6 > -1) {
                     var5 = this.y.getColumnByIndex(var6);
                  } else {
                     var5 = this.y.a(var4 + 1, -var6 - 1);
                     var5.c(15);
                  }

                  var5.b(true);
               }
            } else if (var4 == firstIndex && !this.m.getOutline().SummaryColumnRight) {
               var5.b(true);
               if (var4 > 0) {
                  var6 = this.y.e(var4 - 1);
                  if (var6 > -1) {
                     var5 = this.y.getColumnByIndex(var6);
                  } else {
                     var5 = this.y.a(var4 - 1, -var6 - 1);
                     var5.c(15);
                  }

                  var5.b(true);
               }
            }
         }
      }

   }

   public void ungroupRows(int firstIndex, int lastIndex, boolean isAll) {
      zakq.b(firstIndex, lastIndex);
      zahl var4 = this.k.b(firstIndex, lastIndex, false);
      byte var5;
      int var6;
      if (isAll) {
         while(true) {
            var6 = var4.a();
            if (var6 < 0) {
               break;
            }

            var5 = this.k.k(var6, 0);
            var5 = zbbj.a(var5, 0);
            var5 = zbbj.a(var5, false);
            this.k.a(var6, 0, var5);
         }
      } else {
         while(true) {
            var6 = var4.a();
            if (var6 < 0) {
               break;
            }

            var5 = this.k.k(var6, 0);
            byte var7 = (byte)zbbj.f(var5);
            if ((var7 & 255) > 0) {
               --var7;
               var5 = zbbj.a(var5, var7 & 255);
               if (var7 == 0) {
                  var5 = zbbj.a(var5, false);
               }

               this.k.a(var6, 0, var5);
            } else if (zbbj.b(var5)) {
               var5 = zbbj.a(var5, false);
               this.k.a(var6, 0, var5);
            }
         }
      }

      int var9 = 0;
      int var8 = 0;
      var4 = this.k.b();

      while(true) {
         var6 = var4.a();
         if (var6 < 0) {
            this.A = (byte)var8;
            return;
         }

         var8 = zbbj.f(this.k.k(var6, 0));
         if (var8 >= (this.A & 255)) {
            return;
         }

         if (var8 > var9) {
            var9 = var8;
         }
      }
   }

   public void ungroupRows(int firstIndex, int lastIndex) {
      this.ungroupRows(firstIndex, lastIndex, false);
   }

   public void groupRows(int firstIndex, int lastIndex, boolean isHidden) {
      zakq.b(firstIndex, lastIndex);

      for(int var6 = firstIndex; var6 <= lastIndex; ++var6) {
         Row var7 = this.l.a(var6, false, true, false);
         byte var4 = var7.a.l(0);
         byte var5 = (byte)zbbj.f(var4);
         if ((var5 & 255) < 7) {
            ++var5;
            var4 = zbbj.a(var4, var5 & 255);
         }

         var4 = zbbj.b(var4, isHidden);
         if ((var5 & 255) > (this.A & 255)) {
            this.A = var5;
         }

         if (isHidden) {
            if (var6 == lastIndex && this.m.getOutline().SummaryRowBelow) {
               var4 = zbbj.a(var4, true);
               if (var6 < 1048575) {
                  var7.a.a(0, var4);
                  var7 = this.l.a(var6 + 1, false, true, false);
                  var4 = var7.a.l(0);
                  var4 = zbbj.a(var4, true);
               }
            } else if (var6 == firstIndex && !this.m.getOutline().SummaryRowBelow) {
               var4 = zbbj.a(var4, true);
               if (var6 > 0) {
                  var7.a.a(0, var4);
                  var7 = this.l.a(var6 - 1, false, true, false);
                  var4 = var7.a.l(0);
                  var4 = zbbj.a(var4, true);
               }
            }
         }

         var7.a.a(0, var4);
      }

   }

   public void groupRows(int firstIndex, int lastIndex) {
      zakq.b(firstIndex, lastIndex);

      for(int var3 = firstIndex; var3 <= lastIndex; ++var3) {
         Row var4 = this.l.a(var3, false, true, false);
         if ((var4.h() & 255) < 7) {
            var4.a((byte)((var4.h() & 255) + 1));
         }

         if ((var4.h() & 255) > (this.A & 255)) {
            this.A = var4.h();
         }
      }

   }

   public void deleteColumn(int columnIndex, boolean updateReference) {
      this.r().n().b();
      this.deleteColumn(columnIndex);
      if (updateReference) {
         int var7 = this.r().q().b(this.r().u(), this.m.m());

         for(int var8 = 0; var8 < this.r().getCount(); ++var8) {
            if (var8 != this.m.m()) {
               Worksheet var9 = this.r().get(var8);
               Cells var10 = var9.getCells();
               zr var11 = var10.f();
               if (var11.a() > 0) {
                  zahl var3 = var11.b();

                  label39:
                  while(true) {
                     zp var5;
                     int var6;
                     do {
                        var6 = var3.a();
                        if (var6 < 0) {
                           break label39;
                        }

                        var5 = var11.f(var6);
                     } while(var5.a() <= 0);

                     zahl var4 = var5.b();

                     while(true) {
                        var6 = var4.a();
                        if (var6 < 0) {
                           break;
                        }

                        Cell.a(var5, var6, columnIndex, -1, this.m, false);
                     }
                  }
               }

               if (var9.getCharts().getCount() > 0) {
                  var9.getCharts().b(columnIndex, -1, this.m, false);
               }
            }
         }
      }

   }

   public void deleteColumn(int columnIndex) {
      this.deleteColumns(columnIndex, 1, false);
   }

   public void deleteColumns(int columnIndex, int totalColumns, boolean updateReference) {
      if (totalColumns >= 1) {
         this.r().n().b();
         zakq.b(columnIndex);
         this.y.b(columnIndex, totalColumns);
         if (this.e >= columnIndex) {
            this.e -= (short)totalColumns;
         }

         this.l.c(columnIndex, totalColumns);
         if (updateReference) {
            int var8 = this.r().q().b(this.r().u(), this.m.m());

            for(int var9 = 0; var9 < this.r().getCount(); ++var9) {
               if (var9 != this.m.m()) {
                  Worksheet var10 = this.r().get(var9);
                  Cells var11 = var10.getCells();
                  zr var12 = var11.f();
                  if (var12.a() > 0) {
                     zahl var4 = var12.b();

                     label77:
                     while(true) {
                        zp var6;
                        int var7;
                        do {
                           var7 = var4.a();
                           if (var7 < 0) {
                              break label77;
                           }

                           var6 = var12.f(var7);
                        } while(var6.a() <= 0);

                        zahl var5 = var6.b();

                        while(true) {
                           var7 = var5.a();
                           if (var7 < 0) {
                              break;
                           }

                           Cell.a(var6, var7, columnIndex, -totalColumns, this.m, false);
                        }
                     }
                  }

                  if (var10.getCharts().getCount() > 0) {
                     var10.getCharts().b(columnIndex, -totalColumns, this.m, false);
                  }
               }
            }
         }

         this.i.b(columnIndex, -totalColumns);
         if (this.m.t() != null) {
            this.m.getShapes().b(columnIndex, -totalColumns, this.m, true);
         }

         this.m.e.b(columnIndex, -totalColumns);
         Iterator var13 = this.B.iterator();

         while(var13.hasNext()) {
            Range var14 = (Range)var13.next();
            var14.a(columnIndex, -totalColumns);
         }

         this.r().getNames().a(this.m.m(), columnIndex, -totalColumns);
         this.m.getValidations().a(columnIndex, -totalColumns);
         if (this.m.m != null) {
            this.m.m.b(columnIndex, -totalColumns);
         }

         if (this.m.h()) {
            this.m.b().a(columnIndex, -totalColumns);
         }

         if (this.m.hasAutofilter()) {
            this.m.getAutoFilter().b(columnIndex, -totalColumns);
         }

         if (this.m.getSparklineGroupCollection().getCount() != 0) {
            this.m.getSparklineGroupCollection().b(this, columnIndex, -totalColumns, true);
         }

         if (this.m.getListObjects().getCount() != 0) {
            this.m.getListObjects().e(columnIndex, -totalColumns);
         }

      }
   }

   public boolean isDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns) {
      CellArea var5 = new CellArea();
      var5.StartRow = startRow;
      var5.EndRow = startRow + totalRows - 1;
      var5.StartColumn = startColumn;
      var5.EndColumn = startColumn + totalColumns - 1;
      if (this.m.getListObjects().getCount() != 0 && !this.m.getListObjects().b(startRow, startColumn, totalRows, totalColumns)) {
         return false;
      } else {
         CellArea var8;
         if (this.b.c > 0) {
            zyi[] var6 = this.b.b;

            for(int var7 = var6.length - 1; var7 > -1; --var7) {
               if (var6[var7] != null && var6[var7].l()) {
                  var8 = var6[var7].a().a();
                  if (!zayd.b(var5, var8)) {
                     return false;
                  }
               }
            }
         }

         if (this.m.b != null) {
            for(int var9 = 0; var9 < this.m.b.getCount(); ++var9) {
               PivotTable var10 = this.m.b.get(var9);
               var8 = var10.getTableRange2();
               if (!zayd.b(var5, var8)) {
                  return false;
               }
            }
         }

         return true;
      }
   }

   public boolean deleteRows(int rowIndex, int totalRows) {
      zqw var3 = new zqw();
      var3.b = false;
      return this.a(rowIndex, totalRows, var3);
   }

   public void deleteRow(int rowIndex) {
      zakq.a(rowIndex);
      this.deleteRows(rowIndex, 1);
   }

   public boolean deleteRows(int rowIndex, int totalRows, boolean updateReference) {
      zqw var4 = new zqw();
      var4.b = updateReference;
      return this.a(rowIndex, totalRows, var4);
   }

   boolean a(int var1, int var2, zqw var3) {
      if (var2 <= 0) {
         return false;
      } else {
         this.r().n().b();
         zakq.a(var1);
         if (var1 + var2 > 1048576) {
            var2 = 1048576 - var1;
         }

         this.l.d(var1, var2);
         this.r().getNames().b(this.m.m(), var1, -var2);
         this.i.a(var1, -var2);
         Iterator var4 = this.B.iterator();

         while(var4.hasNext()) {
            Range var5 = (Range)var4.next();
            var5.b(var1, -var2);
         }

         if (this.m.hasAutofilter()) {
            this.m.getAutoFilter().a(var1, -var2);
         }

         this.m.e.a(var1, -var2);
         this.m.getValidations().b(var1, -var2);
         if (this.m.m != null) {
            this.m.getConditionalFormattings().a(var1, -var2);
         }

         if (!var3.a) {
            if (this.m.t() != null) {
               this.m.getShapes().a(var1, -var2, this.m, true);
            }

            if (this.m.g != null) {
               this.m.g.a(var1, -var2);
            }

            if (this.m.h()) {
               this.m.b().b(var1, -var2);
            }

            if (this.m.getHorizontalPageBreaks().getCount() != 0) {
               this.m.getHorizontalPageBreaks().a(var1, -var2);
            }

            if (this.m.getListObjects().getCount() != 0) {
               this.m.getListObjects().d(var1, -var2);
            }

            if (this.m.getSparklineGroupCollection().getCount() != 0) {
               this.m.getSparklineGroupCollection().a(this, var1, -var2, true);
            }

            if (this.m.b != null && this.m.b.getCount() != 0) {
               this.m.b.a(var1, -var2);
            }

            if (this.r().U() != null && this.r().U().getCount() != 0) {
               this.r().U().a(var1, -var2, this.m);
            }
         }

         if (var3.b) {
            int var13 = this.r().q().b(this.r().u(), this.m.m());

            for(int var14 = 0; var14 < this.r().getCount(); ++var14) {
               if (var14 != this.m.m()) {
                  Worksheet var6 = this.r().get(var14);
                  Cells var7 = var6.getCells();
                  zr var8 = var7.f();
                  if (var8.a() > 0) {
                     zahl var9 = var8.b();

                     label94:
                     while(true) {
                        zp var11;
                        int var12;
                        do {
                           var12 = var9.a();
                           if (var12 < 0) {
                              break label94;
                           }

                           var11 = var8.f(var12);
                        } while(var11.a() <= 0);

                        zahl var10 = var11.b();

                        while(true) {
                           var12 = var10.a();
                           if (var12 < 0) {
                              break;
                           }

                           if (var11.h(var12) == 5) {
                              Cell.b(var11, var12, var1, -var2, this.m, false);
                           }
                        }
                     }
                  }

                  if (var6.getCharts().getCount() > 0) {
                     var6.getCharts().a(var1, -var2, this.m, false);
                  }
               }
            }
         }

         return true;
      }
   }

   public void deleteBlankColumns() {
      this.r().n().b();
      if (this.getCount() == 0) {
         this.l.clear();
         this.y.clear();
      }

      int var1;
      if (this.y.getCount() > 0 && this.e < this.y.getColumnByIndex(this.y.getCount() - 1).getIndex()) {
         for(var1 = this.y.getCount() - 1; var1 >= 0 && this.y.getColumnByIndex(var1).getIndex() > this.e; --var1) {
            this.y.removeAt(var1);
         }
      }

      for(var1 = this.e; var1 >= 0; --var1) {
         if (this.isBlankColumn(var1)) {
            this.deleteColumn(var1);
         }
      }

   }

   public boolean isBlankColumn(int columnIndex) {
      this.r().n().b();
      Cell var2 = null;

      for(int var3 = 0; var3 < this.l.getCount(); ++var3) {
         Row var4 = this.l.getRowByIndex(var3);
         var2 = var4.getCellOrNull(columnIndex);
         if (var2 != null && !var2.d()) {
            return false;
         }
      }

      return true;
   }

   public void deleteBlankRows() {
      this.r().n().b();
      zqw var1 = new zqw();
      var1.a = true;
      if (this.getCount() == 0) {
         this.l.clear();
         this.y.clear();
      } else {
         int var2 = -1;

         for(int var3 = this.l.getCount() - 1; var3 >= 0; --var3) {
            Row var4 = this.l.getRowByIndex(var3);
            if (!var4.isBlank()) {
               if (var2 == -1) {
                  var2 = var4.getIndex();
               } else if (var2 != var4.getIndex()) {
                  if (var2 - var4.getIndex() > 1) {
                     this.a(var4.getIndex() + 1, var2 - var4.getIndex() - 1, var1);
                  }

                  var2 = var4.getIndex();
               }
            } else if (var2 == -1) {
               var2 = var4.getIndex() + 1;
            }
         }

         if (var2 >= 0) {
            this.a(0, var2, (zqw)var1);
         } else {
            this.l.clear();
            this.y.clear();
         }

      }
   }

   public void insertColumns(int columnIndex, int totalColumns) {
      this.r().n().b();
      zakq.b(columnIndex);
      this.l.e(columnIndex, totalColumns);
      if (columnIndex <= this.e) {
         this.e += (short)totalColumns;
         if (this.e > 16383) {
            this.e = 16383;
         }
      }

      this.y.c(columnIndex, totalColumns);
      if (this.m.t() != null) {
         this.m.getShapes().b(columnIndex, totalColumns, this.m, true);
      }

      this.m.getValidations().a(columnIndex, totalColumns);
      if (this.m.m != null) {
         this.m.m.b(columnIndex, totalColumns);
      }

      this.m.e.b(columnIndex, totalColumns);
      this.i.b(columnIndex, totalColumns);
      this.d(columnIndex, totalColumns);
      Iterator var3 = this.B.iterator();

      while(var3.hasNext()) {
         Range var4 = (Range)var3.next();
         var4.a(columnIndex, totalColumns);
      }

      this.r().getNames().a(this.m.m(), columnIndex, totalColumns);
      if (this.m.g != null) {
         this.m.g.b(columnIndex, totalColumns);
      }

      if (this.m.h()) {
         this.m.b().a(columnIndex, totalColumns);
      }

      if (this.m.hasAutofilter()) {
         this.m.getAutoFilter().b(columnIndex, totalColumns);
      }

      if (this.m.getSparklineGroupCollection().getCount() != 0) {
         this.m.getSparklineGroupCollection().b(this, columnIndex, totalColumns, true);
      }

      if (this.m.getListObjects().getCount() != 0) {
         this.m.getListObjects().e(columnIndex, totalColumns);
      }

   }

   public void insertColumns(int columnIndex, int totalColumns, boolean updateReference) {
      this.r().n().b();
      this.insertColumns(columnIndex, totalColumns);
      if (updateReference) {
         int var8 = this.r().q().b(this.r().u(), this.m.m());

         for(int var9 = 0; var9 < this.r().getCount(); ++var9) {
            if (var9 != this.m.m()) {
               Worksheet var10 = this.r().get(var9);
               Cells var11 = var10.getCells();
               zr var12 = var11.f();
               if (var12.a() > 0) {
                  zahl var4 = var12.b();

                  label39:
                  while(true) {
                     zp var6;
                     int var7;
                     do {
                        var7 = var4.a();
                        if (var7 < 0) {
                           break label39;
                        }

                        var6 = var12.f(var7);
                     } while(var6.a() <= 0);

                     zahl var5 = var6.b();

                     while(true) {
                        var7 = var5.a();
                        if (var7 < 0) {
                           break;
                        }

                        Cell.a(var6, var7, columnIndex, totalColumns, this.m, false);
                     }
                  }
               }

               if (var10.getCharts().getCount() > 0) {
                  var10.getCharts().b(columnIndex, totalColumns, this.m, false);
               }
            }
         }
      }

   }

   public void insertColumn(int columnIndex, boolean updateReference) {
      this.insertColumns(columnIndex, 1, updateReference);
   }

   public void insertColumn(int columnIndex) {
      this.insertColumns(columnIndex, 1);
   }

   public void insertRows(int rowIndex, int totalRows, boolean updateReference) {
      this.insertRows(rowIndex, totalRows);
      if (updateReference) {
         int var4 = this.r().q().b(this.r().u(), this.m.m());

         for(int var5 = 0; var5 < this.r().getCount(); ++var5) {
            if (var5 != this.m.m()) {
               Worksheet var6 = this.r().get(var5);
               Cells var7 = var6.getCells();
               zr var8 = var7.f();
               if (var8.a() > 0) {
                  zahl var9 = var8.b();
                  zfv var13 = new zfv();
                  var13.c = 5;

                  label54:
                  while(true) {
                     zp var11;
                     Row var12;
                     int var15;
                     do {
                        var15 = var9.a();
                        if (var15 < 0) {
                           break label54;
                        }

                        var11 = var8.f(var15);
                        var12 = null;
                     } while(var11.a() <= 0);

                     zahl var10 = var11.b();

                     while(true) {
                        var15 = var10.a();
                        if (var15 < 0) {
                           break;
                        }

                        if (var11.h(var15) == 5) {
                           zyi var16 = (zyi)var11.i(var15);
                           if (var16.m()) {
                              var13.d = var16;
                              zfv var14 = var11.a(var15, var13, 3);
                              if (var12 == null) {
                                 var12 = new Row(var7, var7.l, var11, false);
                              }

                              Cell var17 = new Cell(var12, var15, var14, var14 == var13);
                              var17.K();
                           }

                           Cell.b(var11, var15, rowIndex, totalRows, this.m, false);
                        }
                     }
                  }
               }

               if (var6.getCharts().getCount() != 0) {
                  var6.getCharts().a(rowIndex, totalRows, this.m, false);
               }
            }
         }
      }

   }

   public void insertRows(int rowIndex, int totalRows) {
      this.a(rowIndex, totalRows, (zakk)null);
   }

   void a(int var1, int var2, zakk var3) {
      if (var3 == null) {
         var3 = new zakk();
      }

      this.r().n().b();
      zakq.a(var1);
      if (var1 + var2 > 1048575) {
         var2 = 1048575 - var1 + 1;
      }

      if (var2 != 0) {
         this.l.a(var1, var2, var3);
         this.r().getNames().b(this.m.m(), var1, var2);
         if (this.m.g != null) {
            this.m.g.a(var1, var2);
         }

         if (this.m.t() != null && this.m.t().getCount() != 0) {
            this.m.getShapes().a(var1, var2, this.m, true);
         }

         this.m.e.a(var1, var2);
         this.i.a(var1, var2);
         Iterator var4 = this.B.iterator();

         while(var4.hasNext()) {
            Range var5 = (Range)var4.next();
            var5.b(var1, var2);
         }

         if (this.m.hasAutofilter()) {
            this.m.getAutoFilter().a(var1, var2);
         }

         this.m.getValidations().b(var1, var2);
         this.m.getConditionalFormattings().a(var1, var2);
         if (this.m.h()) {
            this.m.b().b(var1, var2);
         }

         if (this.m.getHorizontalPageBreaks().getCount() != 0) {
            this.m.getHorizontalPageBreaks().a(var1, var2);
         }

         if (this.m.getListObjects().getCount() != 0) {
            this.m.getListObjects().d(var1, var2);
         }

         if (this.m.getSparklineGroupCollection().getCount() != 0) {
            this.m.getSparklineGroupCollection().a(this, var1, var2, true);
         }

         if (this.m.b != null && this.m.b.getCount() != 0) {
            this.m.b.a(var1, var2);
         }

         if (this.r().U() != null && this.r().U().getCount() != 0) {
            this.r().U().a(var1, var2, this.m);
         }

      }
   }

   public void insertRow(int rowIndex) {
      this.insertRows(rowIndex, 1);
   }

   private void d(int var1, int var2) {
      if (var1 > 0) {
         HashMap var3 = new HashMap();

         int var4;
         for(var4 = 0; var4 < this.getRows().getCount(); ++var4) {
            Row var5 = this.getRows().getRowByIndex(var4);
            Cell var6 = var5.getCellOrNull(var1 - 1);
            if (var6 != null) {
               var3.put(var6.getRow(), var6);
            }
         }

         if (var3.size() != 0) {
            for(var4 = 0; var4 < var2; ++var4) {
               Iterator var8 = var3.keySet().iterator();

               while(var8.hasNext()) {
                  int var9 = (Integer)var8.next();
                  Cell var7 = (Cell)var3.get(var9);
                  this.a(var9, var1 + var4, false).b(var7.s());
               }
            }

         }
      }
   }

   private void b(int var1, int var2, int var3, int var4) {
      if (var1 > 0) {
         HashMap var5 = new HashMap();
         int var6 = this.y.e(var1 - 1);
         int var7 = -1;
         if (var6 > -1) {
            Column var8 = this.y.getColumnByIndex(var6);
            if (var8.e()) {
               var7 = var8.c();
            }
         }

         int var12;
         for(var12 = 0; var12 < this.getRows().getCount(); ++var12) {
            Row var9 = this.getRows().getRowByIndex(var12);
            if (var9.getIndex() >= var3) {
               if (var9.getIndex() > var4) {
                  break;
               }

               Cell var10 = var9.getCellOrNull(var1 - 1);
               if (var10 != null) {
                  var5.put(var10.getRow(), var10.r());
               }
            }
         }

         int var15;
         if (var7 != -1) {
            for(var12 = var3; var12 <= var4; ++var12) {
               if (var5.get(var12) == null) {
                  var5.put(var12, var7);
               }
            }
         } else {
            for(var12 = 0; var12 < var2; ++var12) {
               var6 = this.y.e(var1 + var12);
               if (var6 > -1) {
                  Column var13 = this.y.getColumnByIndex(var6);
                  if (var13.e()) {
                     for(var15 = var3; var15 <= var4; ++var15) {
                        if (var5.get(var15) == null) {
                           Row var11 = this.getRows().a(var15, true, false, false);
                           if (var11 != null && !var11.j()) {
                              var5.put(var15, 15);
                           }
                        }
                     }
                  }
               }
            }
         }

         if (var5.size() != 0) {
            for(var12 = 0; var12 < var2; ++var12) {
               Iterator var14 = var5.keySet().iterator();

               while(var14.hasNext()) {
                  var15 = (Integer)var14.next();
                  this.a(var15, var1 + var12, false).b((Integer)var5.get(var15));
               }
            }

         }
      }
   }

   private void c(int var1, int var2, int var3, int var4) {
      if (var1 > 0) {
         Cell[] var5 = new Cell[var4 - var3 + 1];
         Row var6 = this.getRows().a(var1 - 1, true, false, false);
         boolean var7 = false;
         int var8;
         Cell var9;
         if (var6 != null) {
            var7 = var6.j();

            for(var8 = 0; var8 < var6.a(); ++var8) {
               var9 = var6.getCellByIndex(var8);
               if (var9.getColumn() >= var3 && var9.getColumn() <= var4) {
                  var5[var9.getColumn() - var3] = var9;
               }
            }
         }

         for(var8 = 0; var8 < var2; ++var8) {
            var9 = null;
            boolean var10 = false;
            Row var15 = this.getRows().a(var1 + var8, true, false, false);
            if (var15 != null) {
               var10 = var15.j();
            }

            for(int var11 = 0; var11 < var5.length; ++var11) {
               int var12 = var3 + var11;
               Cell var13 = var5[var11];
               Cell var14 = null;
               if (var13 == null) {
                  if (var7 || var10) {
                     var14 = this.a(var1 + var8, var12, false);
                     if (var7) {
                        var14.b(var6.d());
                     } else {
                        var14.b(15);
                     }
                  }
               } else if (var13.s() != -1 && var13.s() != 15) {
                  var14 = this.a(var1 + var8, var12, false);
                  var14.b(var13.s());
               } else if (var7 || var10) {
                  var14 = this.a(var1 + var8, var12, false);
                  if (var7) {
                     var14.b(var6.d());
                  } else {
                     var14.b(15);
                  }
               }
            }
         }

      }
   }

   public RangeCollection getRanges() {
      return this.B;
   }

   public void clearRange(CellArea range) {
      this.clearRange(range.StartRow, range.StartColumn, range.EndRow, range.EndColumn);
   }

   public void clearRange(int startRow, int startColumn, int endRow, int endColumn) {
      this.r().n().b();
      zakq.a(startRow, startColumn, endRow, endColumn);
      this.getRows().a(startRow, startColumn, endRow, endColumn);
      this.h().getListObjects().a(startRow, startColumn, endRow, endColumn);
   }

   public void clearContents(CellArea range) {
      this.clearContents(range.StartRow, range.StartColumn, range.EndRow, range.EndColumn);
   }

   public void clearContents(int startRow, int startColumn, int endRow, int endColumn) {
      this.r().n().b();
      zakq.a(startRow, startColumn, endRow, endColumn);
      zbpx var5 = this.r().g;
      zahl var6 = this.k.b(startRow, endRow, false);
      if (var6 != null) {
         zfv var10 = new zfv();

         label75:
         while(true) {
            zahl var7;
            zp var8;
            int var9;
            do {
               var9 = var6.a();
               if (var9 < 0) {
                  break label75;
               }

               var8 = this.k.f(var9);
               var7 = var8.b(startColumn, endColumn, false);
            } while(var7 == null);

            while(true) {
               var9 = var7.a();
               if (var9 < 0) {
                  var8.l(-1, -1);
                  break;
               }

               switch(var8.h(var9)) {
               case 4:
                  var5.c(var8.j(var9));
                  break;
               case 5:
                  this.b.b(var8.j(var9));
               }

               var8.b(var9, var10);
            }
         }
      }

      ListObjectCollection var11 = this.m.getListObjects();
      int var12;
      if (var11.getCount() != 0) {
         for(var12 = 0; var12 < var11.getCount(); ++var12) {
            ListObject var13 = var11.get(var12);
            if (var13.getStartRow() >= startRow && var13.getEndRow() <= endRow && var13.getStartColumn() >= startColumn && var13.getEndColumn() <= endColumn) {
               var11.removeAt(var12--);
            }
         }
      }

      if (this.m.getHyperlinks() != null) {
         for(var12 = 0; var12 < this.m.getHyperlinks().getCount(); ++var12) {
            Hyperlink var14 = this.m.getHyperlinks().get(var12);
            if (var14.getArea().StartRow >= startRow && var14.getArea().StartColumn >= startColumn && var14.getArea().EndRow <= endRow && var14.getArea().EndColumn <= endColumn) {
               this.m.getHyperlinks().a(var12--);
            }
         }
      }

   }

   public void clearFormats(CellArea range) {
      this.clearFormats(range.StartRow, range.StartColumn, range.EndRow, range.EndColumn);
   }

   public void clearFormats(int startRow, int startColumn, int endRow, int endColumn) {
      this.r().n().b();
      zakq.a(startRow, startColumn, endRow, endColumn);
      int var5 = this.l.b(startRow, endRow);
      if (var5 != -1) {
         this.n();
         boolean var6 = startColumn == 0 && endColumn == 16383;
         boolean var7 = startRow == 0 && endRow == 1048575;
         if (var7) {
            for(; var5 < this.y.getCount(); ++var5) {
               Column var8 = this.y.getColumnByIndex(var5);
               if (var8.getIndex() >= startColumn) {
                  if (var8.getIndex() > endColumn) {
                     break;
                  }

                  var8.c(15);
               }
            }
         }

         while(var5 < this.l.getCount()) {
            Row var13 = this.l.getRowByIndex(var5);
            if (var13.getIndex() > endRow) {
               break;
            }

            if (var6) {
               var13.e(15);
            }

            for(int var9 = startColumn; var9 <= endColumn; ++var9) {
               Cell var10 = var13.getCellOrNull(var9);
               if (var10 != null) {
                  var10.b(15);
               } else if (var13.j()) {
                  var13.c(var9).b(15);
               } else if (!var7) {
                  int var11 = this.y.e(var9);
                  if (var11 > -1) {
                     Column var12 = this.y.getColumnByIndex(var11);
                     if (var12.c() != 15 && var12.c() != -1) {
                        var13.c(var9).b(15);
                     }
                  }
               }
            }

            ++var5;
         }

      }
   }

   public Cell getEnd() {
      return this.getLastCell();
   }

   public Cell getLastCell() {
      zahr var1 = this.l.a.a(-1, -1, true);

      label25:
      while(true) {
         zp var3;
         do {
            if (!var1.hasNext()) {
               return null;
            }

            var3 = var1.e();
         } while(var3.a() <= 0);

         zahl var2 = var3.a(-1, -1, true);

         int var4;
         do {
            var4 = var2.a();
            if (var4 < 0) {
               continue label25;
            }
         } while(var3.h(var4) == 0);

         return new Cell(var1.f(), var4);
      }
   }

   public Range getMaxDisplayRange() {
      int var1 = this.getMaxRow();
      int var2 = this.getMaxColumn();

      int var3;
      for(var3 = 0; var3 < this.i.getCount(); ++var3) {
         CellArea var4 = this.i.a(var3);
         if (var4.EndRow > var1) {
            var1 = var4.EndRow;
         }

         if (var4.EndColumn > var2) {
            var2 = var4.EndColumn;
         }
      }

      for(var3 = 0; var3 < this.m.getShapes().getCount(); ++var3) {
         Shape var9 = this.m.getShapes().get(var3);
         int var5 = var9.getLowerRightRow();
         int var6 = var9.getLowerRightColumn();
         if (var5 > var1) {
            boolean var7 = true;
            if (var5 >= 1048575) {
               int var8 = var9.getUpperLeftRow();
               if (var8 >= 1048575) {
                  var7 = false;
               }
            }

            if (var7) {
               var1 = var5;
            }
         }

         if (var6 > var2) {
            var2 = var6;
         }
      }

      if (var1 >= 0 && var2 >= 0) {
         return this.createRange(0, 0, var1 == 1048576 ? var1 : var1 + 1, var2 == 16384 ? var2 : var2 + 1);
      } else {
         return this.createRange(0, 0, 1, 1);
      }
   }

   /** @deprecated */
   public Cell getStart() {
      return this.getFirstCell();
   }

   public Cell getFirstCell() {
      zahr var1 = this.l.a.a(-1, -1, false);

      label25:
      while(true) {
         zp var3;
         do {
            if (!var1.hasNext()) {
               return null;
            }

            var3 = var1.e();
         } while(var3.a() <= 0);

         zahl var2 = var3.a(-1, -1, false);

         int var4;
         do {
            var4 = var2.a();
            if (var4 < 0) {
               continue label25;
            }
         } while(var3.h(var4) == 0);

         return new Cell(var1.f(), var4);
      }
   }

   void w() {
      if (this.k.a() >= 1 && this.b.c >= 1) {
         zahl var1 = this.k.b();
         zfv var5 = new zfv();
         var5.c = 5;

         while(true) {
            zp var3;
            Row var4;
            int var7;
            do {
               var7 = var1.a();
               if (var7 < 0) {
                  return;
               }

               var4 = this.l.b(var7, false);
               var3 = var4.a;
            } while(var3.a() <= 0);

            zahl var2 = var3.b();

            while(true) {
               var7 = var2.a();
               if (var7 < 0) {
                  break;
               }

               if (var3.h(var7) == 5) {
                  zyi var8 = (zyi)var3.i(var7);
                  if (var8.m()) {
                     var5.d = var8;
                     zfv var6 = var3.a(var7, var5, 3);
                     (new Cell(var4, var7, var6, var6 == var5)).K();
                  }
               }
            }
         }
      }
   }

   Cell a(CellArea var1, int var2, int var3, zaft var4, boolean var5, boolean var6) {
      if (var1.c()) {
         zp var13 = this.l.a.a(var2);
         if (var13 == null) {
            return null;
         } else {
            int var14;
            if (var1.d()) {
               var14 = var13.b(var3);
               return var14 > -1 && var4.a(var13, var14) ? this.l.a.b(var2).a(var14) : null;
            } else {
               zahl var15;
               if (var5) {
                  var15 = var13.b(var1.StartColumn, var3, var5);
               } else {
                  var15 = var13.b(var3, var1.EndColumn, var5);
               }

               var14 = this.a(var13, var15, var4, var6);
               return var6 && var14 > -1 ? this.l.a.b(var2).a(var14) : null;
            }
         }
      } else {
         zahr var7;
         if (var5) {
            var7 = this.l.a.a(var1.StartRow, var2, var5);
         } else {
            var7 = this.l.a.a(var2, var1.EndRow, var5);
         }

         if (var7 == null) {
            return null;
         } else if (!var7.hasNext()) {
            return null;
         } else {
            zp var8 = var7.e();
            int var9 = var1.StartColumn;
            int var10;
            if (!var1.d()) {
               int var11 = var1.EndColumn;
               zahl var12;
               if (var8.h() == var2) {
                  if (var5) {
                     var12 = var8.b(var9, var3, var5);
                  } else {
                     var12 = var8.b(var3, var11, var5);
                  }
               } else {
                  var12 = var8.b(var9, var11, var5);
               }

               var10 = this.a(var8, var12, var4, var6);
               if (var6 && var10 > -1) {
                  return var7.f().a(var10);
               } else {
                  do {
                     if (!var7.hasNext()) {
                        return null;
                     }

                     var8 = var7.e();
                     var10 = this.a(var8, var8.b(var9, var11, var5), var4, var6);
                  } while(!var6 || var10 <= -1);

                  return var7.f().a(var10);
               }
            } else {
               while(true) {
                  var10 = var8.b(var9);
                  if (var10 > -1 && var4.a(var8, var10) && var6) {
                     return var7.f().a(var10);
                  }

                  if (!var7.hasNext()) {
                     return null;
                  }

                  var8 = var7.e();
               }
            }
         }
      }
   }

   Cell a(int var1, int var2, zaft var3, boolean var4, boolean var5) {
      zahr var6;
      if (var1 < 0) {
         var6 = this.l.a.a(-1, -1, var4);
      } else if (var4) {
         var6 = this.l.a.a(-1, var1, var4);
      } else {
         var6 = this.l.a.a(var1, -1, var4);
      }

      if (var6 == null) {
         return null;
      } else if (!var6.hasNext()) {
         return null;
      } else {
         zp var7 = var6.e();
         zahl var8;
         if (var7.h() == var1 && var2 >= 0) {
            if (var4) {
               var8 = var7.b(-1, var2, var4);
            } else {
               var8 = var7.b(var2, -1, var4);
            }
         } else {
            var8 = var7.a(-1, -1, var4);
         }

         int var9 = this.a(var7, var8, var3, var5);
         if (var5 && var9 > -1) {
            return var6.f().a(var9);
         } else {
            do {
               if (!var6.hasNext()) {
                  return null;
               }

               var7 = var6.e();
               var9 = this.a(var7, var7.a(-1, -1, var4), var3, var5);
            } while(!var5 || var9 <= -1);

            return var6.f().a(var9);
         }
      }
   }

   Cell b(CellArea var1, int var2, int var3, zaft var4, boolean var5, boolean var6) {
      zp[] var7 = this.k.l(var1.StartRow, var1.EndRow);
      if (var7 == null) {
         return null;
      } else {
         int var8;
         zp var9;
         int var10;
         if (var5) {
            for(var10 = var7.length - 1; var10 > -1; --var10) {
               var9 = var7[var10];
               if (var9.h() <= var2) {
                  var8 = var9.b(var3);
                  if (var8 > -1 && var4.a(var9, var8) && var6) {
                     return new Cell(new Row(this, this.l, var9, false), var8);
                  }
               }
            }

            --var3;
            if (var3 < var1.StartColumn) {
               return null;
            }

            do {
               for(var10 = var7.length - 1; var10 > -1; --var10) {
                  var9 = var7[var10];
                  var8 = var9.b(var3);
                  if (var8 > -1 && var4.a(var9, var8) && var6) {
                     return new Cell(new Row(this, this.l, var9, false), var8);
                  }
               }

               --var3;
            } while(var3 >= var1.StartColumn);
         } else {
            for(var10 = 0; var10 < var7.length; ++var10) {
               var9 = var7[var10];
               if (var9.h() >= var2) {
                  var8 = var9.b(var3);
                  if (var8 > -1 && var4.a(var9, var8) && var6) {
                     return new Cell(new Row(this, this.l, var9, false), var8);
                  }
               }
            }

            ++var3;
            if (var3 > var1.EndColumn) {
               return null;
            }

            do {
               for(var10 = 0; var10 < var7.length; ++var10) {
                  var9 = var7[var10];
                  var8 = var9.b(var3);
                  if (var8 > -1 && var4.a(var9, var8) && var6) {
                     return new Cell(new Row(this, this.l, var9, false), var8);
                  }
               }

               ++var3;
            } while(var3 <= var1.EndColumn);
         }

         return null;
      }
   }

   private CellArea z() {
      CellArea var1 = new CellArea();
      var1.StartColumn = this.getMinColumn();
      var1.EndColumn = this.b((short)0);
      var1.StartRow = this.getMinRow();
      var1.EndRow = this.d(0);
      return var1;
   }

   private int a(zp var1, zahl var2, zaft var3, boolean var4) {
      if (var2 == null) {
         return -1;
      } else {
         int var5;
         do {
            var5 = var2.a();
            if (var5 < 0) {
               return -1;
            }
         } while(!var3.a(var1, var5) || !var4);

         return var5;
      }
   }

   private Cell a(Cell var1, zaft var2, boolean var3) {
      if (var1 != null) {
         int var4 = var1.getRow();
         int var5 = var1.getColumn();
         if (var3) {
            --var5;
            if (var5 < 0) {
               --var4;
               if (var4 < 0) {
                  return null;
               }
            }
         } else if (var5 == 16383) {
            if (var4 == 1048575) {
               return null;
            }

            ++var4;
            var5 = -1;
         } else {
            ++var5;
         }

         return this.a(var4, var5, var2, var3, true);
      } else {
         return this.a(-1, -1, var2, var3, true);
      }
   }

   private Cell a(CellArea var1, Cell var2, zaft var3, boolean var4) {
      if (var2 != null) {
         int var5 = var2.getRow();
         int var6 = var2.getColumn();
         if (var4) {
            --var6;
            if (var6 < var1.StartColumn) {
               --var5;
               if (var5 < var1.StartRow) {
                  return null;
               }

               var6 = var1.EndColumn;
            }
         } else {
            ++var6;
            if (var6 > var1.EndColumn) {
               ++var5;
               if (var5 > var1.EndRow) {
                  return null;
               }

               var6 = var1.StartColumn;
            }
         }

         return this.a(var1, var5, var6, var3, var4, true);
      } else {
         return var4 ? this.a(var1, var1.EndRow, var1.EndColumn, var3, var4, true) : this.a(var1, var1.StartRow, var1.StartColumn, var3, var4, true);
      }
   }

   private Cell b(CellArea var1, Cell var2, zaft var3, boolean var4) {
      if (var2 != null) {
         int var5 = var2.getRow();
         int var6 = var2.getColumn();
         if (var4) {
            --var5;
            if (var5 < var1.StartRow) {
               --var6;
               if (var6 < var1.StartColumn) {
                  return null;
               }

               var5 = var1.EndRow;
            }
         } else {
            ++var5;
            if (var5 > var1.EndRow) {
               ++var6;
               if (var6 > var1.EndColumn) {
                  return null;
               }

               var5 = var1.StartRow;
            }
         }

         return this.b(var1, var5, var6, var3, var4, true);
      } else {
         return var4 ? this.b(var1, var1.EndRow, var1.EndColumn, var3, var4, true) : this.b(var1, var1.StartRow, var1.StartColumn, var3, var4, true);
      }
   }

   public Cell findFormula(String formula, Cell previousCell) {
      return this.a(previousCell, new zgn(this, formula, false), false);
   }

   public Cell findFormulaContains(String formula, Cell previousCell) {
      return this.a(previousCell, new zgn(this, formula.toUpperCase(), true), false);
   }

   /** @deprecated */
   public Cell findString(String inputString, Cell previousCell) {
      return this.findString(inputString, previousCell, false);
   }

   /** @deprecated */
   public Cell findString(String inputString, Cell previousCell, CellArea area) {
      return this.findString(inputString, previousCell, area, false);
   }

   /** @deprecated */
   public Cell findString(String inputString, Cell previousCell, CellArea area, boolean upDown) {
      return this.a((CellArea)area, (Cell)previousCell, new zgp(new zbpv(inputString, false, false)), upDown);
   }

   /** @deprecated */
   public Cell findString(String inputString, Cell previousCell, boolean upDown) {
      return this.a(previousCell, new zgp(new zbpv(inputString, false)), upDown);
   }

   /** @deprecated */
   public Cell findString(String inputString, Cell previousCell, FindOptions findOptions) {
      return this.a(previousCell, new zgp(new zbpv(inputString, !findOptions.getCaseSensitive())), false);
   }

   /** @deprecated */
   public Cell findStringStartsWith(String inputString, Cell previousCell) {
      FindOptions var3 = new FindOptions();
      var3.setCaseSensitive(true);
      var3.setLookAtType(1);
      return this.a(previousCell, new zgq(this, new zbpu(inputString, var3)), false);
   }

   /** @deprecated */
   public Cell findStringEndsWith(String inputString, Cell previousCell) {
      FindOptions var3 = new FindOptions();
      var3.setCaseSensitive(true);
      var3.setLookAtType(2);
      return this.a(previousCell, new zgq(this, new zbpu(inputString, var3)), false);
   }

   /** @deprecated */
   public Cell findStringContains(String inputString, Cell previousCell) {
      return this.findStringContains(inputString, previousCell, false);
   }

   /** @deprecated */
   public Cell findStringContains(String inputString, Cell previousCell, boolean isCaseSensitive, CellArea area) {
      FindOptions var5 = new FindOptions();
      var5.setCaseSensitive(isCaseSensitive);
      var5.setLookAtType(0);
      return this.a((CellArea)area, (Cell)previousCell, new zgq(this, new zbpu(inputString, var5)), false);
   }

   /** @deprecated */
   public Cell findStringContains(String inputString, Cell previousCell, boolean isCaseSensitive) {
      FindOptions var4 = new FindOptions();
      var4.setCaseSensitive(isCaseSensitive);
      var4.setLookAtType(0);
      return this.a(previousCell, new zgq(this, new zbpu(inputString, var4)), false);
   }

   /** @deprecated */
   public Cell findNumber(int inputNumber, Cell previousCell) {
      FindOptions var3 = new FindOptions();
      var3.setLookAtType(3);
      var3.a(true);
      return this.a(previousCell, new zgl(this, inputNumber, var3), false);
   }

   /** @deprecated */
   public Cell findNumber(double inputNumber, Cell previousCell) {
      FindOptions var4 = new FindOptions();
      var4.setLookAtType(3);
      var4.a(true);
      return this.a(previousCell, new zgl(this, inputNumber, var4), false);
   }

   public Cell find(Object what, Cell previousCell, FindOptions findOptions) {
      if (findOptions.getLookInType() == 3) {
         CommentCollection var4 = this.h().getComments();

         for(int var5 = 0; var5 < var4.getCount(); ++var5) {
            Comment var6 = var4.get(var5);
            this.a(var6.getRow(), var6.getColumn(), false);
         }
      }

      if (findOptions.getSeachOrderByRows()) {
         return findOptions.isRangeSet() ? this.a((CellArea)findOptions.getRange(), (Cell)previousCell, new zgl(this, what, findOptions), !findOptions.getSearchNext()) : this.a(previousCell, new zgl(this, what, findOptions), !findOptions.getSearchNext());
      } else {
         CellArea var8 = this.z();
         if (findOptions.isRangeSet()) {
            CellArea var9 = findOptions.getRange();
            if (var8.StartColumn < var9.StartColumn) {
               var8.StartColumn = var9.StartColumn;
            }

            if (var8.EndColumn > var9.EndColumn) {
               var8.EndColumn = var9.EndColumn;
            }

            if (var8.StartColumn > var8.EndColumn) {
               return null;
            }

            if (var8.StartRow < var9.StartRow) {
               var8.StartRow = var9.StartRow;
            }

            if (var8.EndRow > var9.EndRow) {
               var8.EndRow = var9.EndRow;
            }

            if (var8.StartRow > var8.EndRow) {
               return null;
            }
         }

         return this.b(var8, previousCell, new zgl(this, what, findOptions), !findOptions.getSearchNext());
      }
   }

   public Cell endCellInRow(int rowIndex) {
      zakq.a(rowIndex);
      Row var2 = this.l.a.b(rowIndex);
      if (var2 == null) {
         return null;
      } else {
         zp var3 = var2.a;
         if (var3.a() < 1) {
            return null;
         } else {
            zahl var4 = var3.a(-1, -1, true);

            int var5;
            do {
               var5 = var4.a();
               if (var5 < 0) {
                  return null;
               }
            } while(var3.h(var5) == 0);

            return new Cell(var2, var5);
         }
      }
   }

   public Cell endCellInColumn(short columnIndex) {
      return this.a((zahr)this.l.a.a(-1, -1, true), columnIndex);
   }

   public Cell endCellInColumn(int startRow, int endRow, short startColumn, short endColumn) {
      zakq.a(startRow, startColumn, endRow, endColumn);
      zahr var5 = this.l.a.a(startRow, endRow, true);
      Cell var8 = null;

      do {
         label33:
         while(true) {
            zp var6;
            zahl var7;
            do {
               if (!var5.hasNext()) {
                  return var8;
               }

               var6 = var5.e();
               var7 = var6.b(startColumn, endColumn, true);
            } while(var7 == null);

            int var9;
            do {
               var9 = var7.a();
               if (var9 < 0) {
                  continue label33;
               }
            } while(var6.h(var9) == 0);

            var8 = new Cell(var5.f(), var9);
            if (var8.getColumn() == endColumn) {
               return var8;
            }

            startColumn = (short)(var8.getColumn() + 1);
            break;
         }
      } while(startColumn != endColumn);

      Cell var10 = this.a((zahr)var5, startColumn);
      if (var10 != null) {
         return var10;
      } else {
         return var8;
      }
   }

   private Cell a(zahr var1, int var2) {
      while(true) {
         if (var1.hasNext()) {
            zp var3 = var1.e();
            int var4 = var3.b(var2);
            if (var4 <= -1 || var3.h(var4) == 0) {
               continue;
            }

            return new Cell(var1.f(), var4);
         }

         return null;
      }
   }

   public Cell endCellInRow(int startRow, int endRow, int startColumn, int endColumn) {
      zakq.a(startRow, startColumn, endRow, endColumn);
      zahr var5 = this.l.a.a(startRow, endRow, true);
      if (startColumn == endColumn) {
         return this.a(var5, startColumn);
      } else {
         label22:
         while(var5.hasNext()) {
            zp var6 = var5.e();
            zahl var8 = var6.b(startColumn, endColumn, true);

            int var7;
            do {
               var7 = var8.a();
               if (var7 < 0) {
                  continue label22;
               }
            } while(var6.h(var7) == 0);

            return new Cell(var5.f(), var7);
         }

         return null;
      }
   }

   public void moveRange(CellArea sourceArea, int destRow, int destColumn) {
      this.r().n().b();
      Range var4 = new Range(sourceArea.StartRow, sourceArea.StartColumn, sourceArea.EndRow - sourceArea.StartRow + 1, sourceArea.EndColumn - sourceArea.StartColumn + 1, this);
      var4.moveTo(destRow, destColumn);
   }

   public void insertRange(CellArea area, int shiftNumber, int shiftType, boolean updateReference) {
      this.r().n().b();
      if (shiftType != 1 && shiftType != 4 && shiftType != 2) {
         this.l.a(area, shiftNumber, shiftType, this.m, true);
         this.a(area, shiftNumber, shiftType, this.m, true);
         if (updateReference) {
            int var5 = this.r().q().b(this.r().u(), this.m.m());

            for(int var6 = 0; var6 < this.r().getCount(); ++var6) {
               if (var6 != this.m.m()) {
                  Worksheet var7 = this.r().get(var6);
                  Cells var8 = this.r().get(var6).getCells();

                  for(int var9 = 0; var9 < var8.l.getCount(); ++var9) {
                     Row var10 = var8.l.getRowByIndex(var9);

                     for(int var11 = 0; var11 < var10.a(); ++var11) {
                        Cell var12 = var10.getCellByIndex(var11);
                        if (var12.f()) {
                           byte[] var13 = var12.v();
                           zyo.a(area, shiftNumber, shiftType, this.m, false, var13, -1, -1, var12.getRow(), var12.getColumn(), var12.getRow(), var12.getColumn());
                        }
                     }
                  }

                  var8.a(area, shiftNumber, shiftType, this.m, false);
               }
            }
         }

      } else {
         throw new CellsException(6, "Invalid shift option.");
      }
   }

   public void insertRange(CellArea area, int shiftType) {
      this.r().n().b();
      boolean var3 = false;
      int var4;
      if (shiftType == 3) {
         var4 = area.EndColumn - area.StartColumn + 1;
      } else {
         var4 = area.EndRow - area.StartRow + 1;
      }

      this.insertRange(area, var4, shiftType, true);
   }

   public void insertRange(CellArea area, int shiftNumber, int shiftType) {
      this.insertRange(area, shiftNumber, shiftType, true);
   }

   private void a(CellArea var1, int var2, int var3, Worksheet var4, boolean var5) {
      if (var5) {
         switch(var3) {
         case 0:
            this.c(var1.StartRow, var2, var1.StartColumn, var1.EndColumn);
            this.i.d(var1, var2);
            break;
         case 1:
            this.i.a(var1, var2);
         case 2:
         default:
            break;
         case 3:
            this.b(var1.StartColumn, var2, var1.StartRow, var1.EndRow);
            this.i.c(var1, var2);
            break;
         case 4:
            this.i.b(var1, var2);
         }
      }

      if (this.m.t() != null) {
         this.m.getShapes().a(var1, var2, var3, var4, var5);
      }

      if (var5) {
         if (this.m.m != null) {
            this.m.getConditionalFormattings().a(var1, var2, var3, this.m, true);
         }

         this.m.getValidations().a(var1, var2, var3, this.m, true);
         this.r().getNames().a(this.m, var1, var2, var3);
         this.m.e.a(var1, var2, var3);
         this.m.getListObjects().a(var1, var2, var3);
         this.m.getPivotTables().a(var1, var2, var3);
      }

   }

   public void deleteRange(int startRow, int startColumn, int endRow, int endColumn, int shiftType) {
      this.r().n().b();
      if (shiftType != 3 && shiftType != 0) {
         zakq.a(startRow, startColumn, endRow, endColumn);
         CellArea var6 = new CellArea();
         var6.StartRow = startRow;
         var6.StartColumn = startColumn;
         var6.EndRow = endRow;
         var6.EndColumn = endColumn;
         int var7 = this.l.a(startRow, startColumn, endRow, endColumn, shiftType, this.m, true);
         if (shiftType != 2) {
            label44:
            for(int var8 = 0; var8 < this.r().getCount(); ++var8) {
               Worksheet var9 = this.r().get(var8);
               if (this.m != var9) {
                  zr var10 = var9.getCells().f();
                  zahl var11 = var10.b();

                  while(true) {
                     zp var13;
                     int var14;
                     do {
                        var14 = var11.a();
                        if (var14 < 0) {
                           continue label44;
                        }

                        var13 = var10.f(var14);
                     } while(var13.a() <= 0);

                     zahl var12 = var13.b();
                     int var15 = var13.h();

                     while(true) {
                        var14 = var12.a();
                        if (var14 < 0) {
                           break;
                        }

                        if (var13.h(var14) == 5) {
                           Cell.a((zyi)var13.i(var14), shiftType, var6, var7, this.m, false);
                        }
                     }
                  }
               }
            }
         }

         this.a(var6, var7, shiftType, this.m, true);
      } else {
         throw new CellsException(6, "Invalid shift option.");
      }
   }

   public Object[][] exportArray(int firstRow, int firstColumn, int totalRows, int totalColumns) {
      if (totalRows != 0 && totalColumns != 0) {
         zakq.a(firstRow, firstColumn, firstRow + totalRows - 1, firstColumn + totalColumns - 1);
         Object[][] var5 = new Object[totalRows][totalColumns];

         for(int var6 = 0; var6 < totalRows; ++var6) {
            Row var7 = this.l.a(firstRow + var6, true, false, false);
            if (var7 != null && var7.a() != 0) {
               for(int var8 = 0; var8 < totalColumns; ++var8) {
                  Cell var9 = var7.getCellOrNull(firstColumn + var8);
                  if (var9 != null) {
                     switch(var9.getType()) {
                     case 1:
                        var5[var6][var8] = var9.getDateTimeValue();
                        break;
                     case 4:
                        double var10 = var9.getDoubleValue();
                        if (var10 <= 2.147483647E9D && var10 >= -2.147483648E9D && Math.abs(var10 - (double)((int)var10)) < Double.MIN_VALUE) {
                           var5[var6][var8] = (int)var10;
                           break;
                        }

                        var5[var6][var8] = var10;
                        break;
                     default:
                        var5[var6][var8] = var9.getValue();
                     }
                  }
               }
            }
         }

         return var5;
      } else {
         return (Object[][])null;
      }
   }

   public int[][] exportTypeArray(int firstRow, int firstColumn, int totalRows, int totalColumns) {
      if (totalRows != 0 && totalColumns != 0) {
         zakq.a(firstRow, firstColumn, firstRow + totalRows - 1, firstColumn + totalColumns - 1);
         int[][] var5 = new int[totalRows][totalColumns];

         for(int var6 = 0; var6 < totalRows; ++var6) {
            Row var7 = this.l.a(firstRow + var6, true, false, false);
            int var8;
            if (var7 != null && var7.a() != 0) {
               for(var8 = 0; var8 < totalColumns; ++var8) {
                  Cell var9 = var7.getCellOrNull(var8 + firstColumn);
                  if (var9 != null) {
                     var5[var6][var8] = var9.getType();
                  } else {
                     var5[var6][var8] = 3;
                  }
               }
            } else {
               for(var8 = 0; var8 < totalColumns; ++var8) {
                  var5[var6][var8] = 3;
               }
            }
         }

         return var5;
      } else {
         return (int[][])null;
      }
   }

   public int importCustomObjects(Collection list, String[] propertyNames, boolean isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, boolean insertRows, String dateFormatString, boolean convertStringToNumber) {
      ImportTableOptions var10 = new ImportTableOptions();
      var10.setFieldNameShown(isPropertyNameShown);
      var10.setTotalRows(rowNumber);
      var10.setInsertRows(insertRows);
      var10.setDateFormat(dateFormatString);
      var10.setConvertNumericData(convertStringToNumber);
      ICellsDataTable var11 = zbni.a(list);
      if (var11 == null) {
         if (isPropertyNameShown && propertyNames != null) {
            for(int var15 = 0; var15 < propertyNames.length; ++var15) {
               this.get(firstRow, firstColumn + var15).putValue(propertyNames[var15]);
            }

            return 1;
         } else {
            return 0;
         }
      } else {
         if (propertyNames != null) {
            var10.setColumnIndexes(new int[propertyNames.length]);
            String[] var12 = var11.getColumns();

            for(int var13 = 0; var13 < propertyNames.length; ++var13) {
               for(int var14 = 0; var14 < var12.length; ++var14) {
                  if (com.aspose.cells.b.a.zv.c(propertyNames[var13], var12[var14]) == 0) {
                     var10.getColumnIndexes()[var13] = var14;
                     break;
                  }
               }
            }
         }

         return this.importData(var11, firstRow, firstColumn, var10);
      }
   }

   public int importCustomObjects(Collection list, int firstRow, int firstColumn, ImportTableOptions options) {
      ICellsDataTable var5 = zbni.a(list);
      return var5 == null ? 0 : this.importData(var5, firstRow, firstColumn, options);
   }

   public void subtotal(CellArea ca, int groupBy, int function, int[] totalList) {
      this.subtotal(ca, groupBy, function, totalList, true, false, true);
   }

   public void subtotal(CellArea ca, int groupBy, int function, int[] totalList, boolean replace, boolean pageBreaks, boolean summaryBelowData) {
      if (totalList != null) {
         zbqe var8 = new zbqe(this);
         var8.a(ca, groupBy, function, totalList, replace, pageBreaks, summaryBelowData);
      }
   }

   void b(int var1, int var2) {
      Row var3 = this.l.d.a(var1);
      zp var4 = null;
      int var5;
      if (var3 != null) {
         var4 = var3.a;
         var4.f();
      } else {
         var5 = this.k.b(var1);
         if (var5 < 0) {
            return;
         }

         var4 = this.k.f(var5);
      }

      var5 = var4.b(var2);
      if (var5 >= 0) {
         zgy.a(this, var4, var5);
         if (var3 != null) {
            var3.b.a();
         }

         this.n();
      }
   }

   public void removeFormulas() {
      if (this.k.a() < 1) {
         this.b.a();
      } else {
         zahl var1 = this.k.b();
         zfv var5 = new zfv();

         while(true) {
            zp var3;
            int var6;
            do {
               var6 = var1.a();
               if (var6 < 0) {
                  return;
               }

               var3 = this.k.f(var6);
            } while(var3.a() <= 0);

            zahl var2 = var3.b();

            while(true) {
               var6 = var2.a();
               if (var6 < 0) {
                  break;
               }

               if (var3.h(var6) == 5) {
                  zyi var4 = (zyi)var3.i(var6);
                  var5.c = var4.c;
                  if (var4.c == 4) {
                     var5.d = this.r().g.a((String)var4.d);
                  } else {
                     var5.d = var4.d;
                  }

                  var3.b(var6, var5, 4);
               }
            }
         }
      }
   }

   public void removeDuplicates(int startRow, int startColumn, int endRow, int endColumn) {
      int var5 = Math.min(endRow, this.d(0));
      if (var5 != -1) {
         boolean[] var6 = new boolean[var5 - startRow + 1];

         int var7;
         int var9;
         int var12;
         for(var7 = startRow; var7 <= var5; ++var7) {
            if (!var6[var7 - startRow]) {
               Row var8 = this.checkRow(var7);

               for(var9 = var7 + 1; var9 <= var5; ++var9) {
                  if (!var6[var9 - startRow]) {
                     boolean var10 = true;
                     Row var11 = this.checkRow(var9);
                     if (var8 == null && var11 == null) {
                        var6[var9 - startRow] = true;
                     } else {
                        for(var12 = startColumn; var12 <= endColumn; ++var12) {
                           Cell var13 = var8 == null ? null : var8.getCellOrNull(var12);
                           Cell var14 = var11 == null ? null : var11.getCellOrNull(var12);
                           if (var13 != null && var13.getType() != 3) {
                              if (var14 == null) {
                                 var10 = false;
                                 break;
                              }

                              if (!var13.c.b(var14.c)) {
                                 var10 = false;
                                 break;
                              }
                           } else if (var14 != null && var14.getType() != 3) {
                              var10 = false;
                              break;
                           }
                        }

                        if (var10) {
                           var6[var9 - startRow] = true;
                        }
                     }
                  }
               }
            }
         }

         var7 = 0;

         for(int var15 = 0; var15 < var6.length; ++var15) {
            if (var6[var15]) {
               var9 = 1;

               int var17;
               for(var17 = var15++; var15 < var6.length; ++var15) {
                  if (!var6[var15]) {
                     --var15;
                     break;
                  }

                  ++var9;
               }

               int var16 = startRow + var17 - var7;
               var12 = var16 + var9 - 1;
               this.deleteRange(var16, startColumn, var12, endColumn, 4);
               var7 += var9;
            }
         }

      }
   }

   public void convertStringToNumericValue() {
      zahl var1 = this.k.b();
      zbpx var4 = this.r().g;
      zfv var5 = new zfv();

      while(true) {
         zp var3;
         int var6;
         do {
            var6 = var1.a();
            if (var6 < 0) {
               return;
            }

            var3 = this.k.f(var6);
         } while(var3.a() <= 0);

         zahl var2 = var3.b();

         while(true) {
            var6 = var2.a();
            if (var6 < 0) {
               break;
            }

            if (var3.h(var6) == 4) {
               zayy var7 = (zayy)var3.i(var6);
               zati var8 = zyc.a(var7.c, this.r().n().getSettings().e());
               if (var8 != null) {
                  var5.c = 0;
                  switch(var8.a()) {
                  case 1:
                     var5.a((DateTime)var8.d(), this.h().getWorkbook().getSettings().getDate1904());
                     break;
                  case 4:
                     var5.c = 1;
                     var5.d = (Double)var8.d();
                     break;
                  default:
                     if (!var5.a(var8.d(), this.k.c())) {
                        var5.c = 0;
                     }
                  }

                  if (var5.c != 0) {
                     var4.b(var7);
                     var3.b(var6, var5, 4);
                  }
               }
            }
         }
      }
   }

   public Cell[] getDependents(boolean isAll, int row, int column) {
      int var4 = this.r().q().f(this.r().u(), this.m.getIndex(), this.m.getIndex());
      HashMap var5 = new HashMap();

      for(int var6 = 0; var6 < this.r().getNames().getCount(); ++var6) {
         Name var7 = this.r().getNames().get(var6);
         if (var7.b() != null) {
            Range var8 = var7.getRange();
            if (var8 != null && var8.getWorksheet().getIndex() == this.m.getIndex() && var8.getFirstRow() <= row && var8.getFirstRow() + var8.getRowCount() - 1 >= row && var8.getFirstColumn() <= column && var8.getFirstColumn() + var8.getColumnCount() - 1 >= column) {
               var5.put(var6, true);
            } else if (zyo.a(0, 0, var7.b(), -1, -1, row, column, var4, this, false, var5)) {
               var5.put(var6, true);
            }
         }
      }

      ArrayList var19 = new ArrayList();
      zfv var10 = new zfv();

      for(int var12 = 0; var12 < this.r().getCount(); ++var12) {
         Cells var13 = this.r().get(var12).getCells();
         boolean var14 = var13 == this;
         if ((var14 || isAll) && var13.b.c >= 1) {
            zyi[] var20 = var13.b.b;
            var13.l.a(16);
            zafu var9 = var13.l.a;

            try {
               for(int var15 = 0; var15 < var20.length; ++var15) {
                  if (var20[var15] != null) {
                     zyi var21 = var20[var15];
                     var10.a = var21.f;
                     zfv var11 = var9.a(var21.e, var10, 4);
                     if (var11 == null || var11.c != 5 || var11.d != var21) {
                        var13.b.b(var15);
                     }

                     if (zyo.a(var21.e, var21.f, var21.b, -1, -1, row, column, var4, var13, var14, var5)) {
                        com.aspose.cells.b.a.a.ze.a(var19, (Object)var9.a(var21.e, var21.f));
                     }
                  }
               }
            } finally {
               var13.l.a();
            }
         }
      }

      Cell[] var22 = new Cell[var19.size()];

      for(int var23 = 0; var23 < var19.size(); ++var23) {
         var22[var23] = (Cell)var19.get(var23);
      }

      var19.clear();
      var19 = null;
      return var22;
   }

   Style a(Style var1, int var2, int var3, int var4, int var5, boolean var6, zafu var7) {
      if (var2 != var4 && (var1.d() == null || var1.getBorders().getByBorderType(4).getLineStyle() == 0)) {
         Row var8 = var7.b(var2 - 1);
         if (var8 != null && !var8.isHidden()) {
            Cell var9 = var8.getCellOrNull(var3);
            if (var9 != null) {
               Style var10 = var9.p();
               if (var10.d() != null && var10.getBorders().getByBorderType(8).getLineStyle() != 0) {
                  if (var6) {
                     var1 = new Style(var1.e());
                     var6 = false;
                  }

                  var1.getBorders().getByBorderType(4).setLineStyle(var10.getBorders().getByBorderType(8).getLineStyle());
                  var1.getBorders().getByBorderType(4).a.f(var10.getBorders().getByBorderType(8).a);
               }
            }
         }
      }

      if (var2 != var5) {
         int var13 = var1.d() == null ? 0 : var1.getBorders().getByBorderType(8).getLineStyle();
         Row var14 = var7.b(var2 + 1);
         if (var14 != null && !var14.isHidden()) {
            Cell var15 = var14.getCellOrNull(var3);
            if (var15 != null) {
               Style var11 = var15.p();
               int var12 = var11.d() == null ? 0 : var11.getBorders().getByBorderType(4).getLineStyle();
               if (zsk.a(var13, var12)) {
                  if (var6) {
                     var1 = new Style(var1.e());
                     var6 = false;
                  }

                  var1.getBorders().getByBorderType(8).setLineStyle(var11.getBorders().getByBorderType(4).getLineStyle());
                  var1.getBorders().getByBorderType(8).a.f(var11.getBorders().getByBorderType(4).a);
               }
            }
         }
      }

      return var1;
   }

   Style a(Style var1, zp var2, int var3, int var4, int var5, int var6, boolean var7) {
      Style var8 = var1;
      int var9 = var4;
      if (var4 < 0) {
         var9 = -var4 - 1;
      }

      int var10;
      Style var11;
      if (var3 != var5 && (var1.d() == null || var1.getBorders().getByBorderType(1).getLineStyle() == 0) && !this.isColumnHidden(var3 - 1)) {
         var10 = var2.a(var3 - 1, var9);
         if (var10 > -1) {
            var11 = Cell.c(this, var2, var10);
            if (var11.d() != null && var11.getBorders().getByBorderType(2).getLineStyle() != 0) {
               if (var7) {
                  var8 = new Style(var1.e());
                  var7 = false;
               }

               var8.getBorders().getByBorderType(1).setLineStyle(var11.getBorders().getByBorderType(2).getLineStyle());
               var8.getBorders().getByBorderType(1).a.f(var11.getBorders().getByBorderType(2).a);
            }
         }
      }

      if (var3 != var6 && (var8.d() == null || var8.getBorders().getByBorderType(2).getLineStyle() == 0) && !this.isColumnHidden(var3 + 1)) {
         var10 = var2.a(var3 + 1, var9);
         if (var10 > -1) {
            var11 = Cell.c(this, var2, var10);
            if (var11.d() != null && var11.getBorders().getByBorderType(1).getLineStyle() != 0) {
               if (var7) {
                  var8 = new Style(var8.e());
                  var7 = false;
               }

               var8.getBorders().getByBorderType(2).setLineStyle(var11.getBorders().getByBorderType(1).getLineStyle());
               var8.getBorders().getByBorderType(2).a.f(var11.getBorders().getByBorderType(1).a);
            }
         }
      }

      return var8;
   }

   public Style getCellStyle(int row, int column) {
      return this.a(this.l.a.b(row), row, column, true);
   }

   Style b(int var1, int var2, boolean var3) {
      return this.a(this.l.a.b(var1), var1, var2, var3);
   }

   Style a(Row var1, int var2, int var3, boolean var4) {
      int var5 = -1;
      int var6 = -1;
      if (var1 != null) {
         var6 = var1.d(var3);
         if (var6 > -1) {
            var5 = var1.a.g(var6);
         }

         if (var5 < 0) {
            var5 = Row.e(var1.a);
            if (var5 == 15) {
               var5 = this.e(var3);
               if (var5 < 0) {
                  var5 = 15;
               }
            }
         }
      } else {
         var5 = this.e(var3);
         if (var5 == -1) {
            var5 = 15;
         }
      }

      Style var7 = new Style(this.r());
      var7.a(this.r(), var5);
      if (var4) {
         this.a(var7, var2, var3, 0, 1048575, false, this.l.a);
      }

      if (var1 != null && var4) {
         this.a(var7, var1.a, var3, var6, 0, 16383, false);
      }

      return var7;
   }

   int c(int var1, int var2) {
      Row var3 = this.l.a.b(var1);
      if (var3 != null) {
         int var4 = var3.d(var2);
         int var5;
         if (var4 > -1) {
            var5 = var3.a.g(var4);
            if (var5 > -1) {
               return var5;
            }
         }

         var5 = Row.e(var3.a);
         if (var5 != 15) {
            return var5;
         }
      }

      return this.e(var2);
   }

   int e(int var1) {
      return this.d.a(var1);
   }

   ArrayList x() {
      ArrayList var1 = new ArrayList();
      if (this.m.b != null) {
         ArrayList var2 = this.m.b.a();
         com.aspose.cells.b.a.a.ze.a(var1, (Collection)var2);
      }

      return var1.size() == 0 ? null : var1;
   }

   public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown) throws Exception {
      return ztm.a(this, rs, rowIndex, columnIndex, rowNum, columnNum, isFieldNameShown, (String)null, false);
   }

   public int importResultSet(ResultSet rs, String startCell, int rowNum, int columnNum, boolean isFieldNameShown) throws Exception {
      return ztm.a(this, rs, startCell, rowNum, columnNum, isFieldNameShown);
   }

   public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown) throws Exception {
      return ztm.a(this, rs, rowIndex, columnIndex, isFieldNameShown);
   }

   public int importResultSet(ResultSet rs, String startCell, boolean isFieldNameShown) throws Exception {
      return ztm.a(this, rs, startCell, isFieldNameShown);
   }

   public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber) throws Exception {
      return ztm.a(this, rs, rowIndex, columnIndex, rowNum, columnNum, isFieldNameShown, customDateFormatString, convertStringToNumber);
   }

   public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber) throws Exception {
      return ztm.a(this, rs, rowIndex, columnIndex, isFieldNameShown, customDateFormatString, convertStringToNumber);
   }
}
